unlimited length
all private members must have leading and trailing underscores
Preferred Installer Program
None of the above
List
Array
Matrix
Set
What is the output of the following code ?
import numpy as npy = np.array([[11, 12, 13, 14], [32, 33, 34, 35]])print(y.ndim)
1
2
3
0
What will be output for the following code ?
import numpy as np
ary=np.array([1,2,3,5,8])
ary=ary+1
print(ary[1])
rank
dtype
shape
None of these
shape, dtype, ndim
objects, type, list
objects, non vectorization
Unicode and shape
arr=np.float([1,2,3,4])
arr=np.array([1,2,3,4]).toFloat()
arr=np.array([1,2,3,4],dtype='float')
arr=np.farray([1,2,3,4])
np.array()
np.zeros()
np.empty()
All of the above
What is the output of the following code?
import numpy as np a=np.array([1,2,3,5,8]) b=np.array([0,3,4,2,1]) c=a+b c=c*a print(c[2])
10
21
12
28
What will be the output of the following ?
import numpy as npa=np.array([2,4,1])b=np.array([3,5])c=a+bprint(c)
[2 4 1 3 5 ]
[5 9 1]
15
ValueError
What is a correct syntax to print the numbers [3, 4, 5] from the array below:
arr = np.array([1,2,3,4,5,6,7])
print(arr[2:4])
print(arr[2:5])
print(arr[2:6])
print(arr[3:6])
np.ndim(array_name)
array_name.ndim()
np.dim(array_name)
array_name.dim
Indexed
Sliced
Iterated
All of the mentioned above
import numpy as nparr=np.array([1,2,3])print(arr.shape)
(3,)
(4,)
What will be output for the following code?
import numpy as npa = np.array([1,2,3,5,8])b = np.array([0,3,4,2,1])c = a + bc = c*aprint (c[2])
18
20
22
It creates a new Python list.
It creates a NumPy array.
It performs element-wise addition.
It calculates the mean of an array.
Tuple
Web development
Machine learning and scientific computing
Game development
Database management
What will be the output of the following Python code?
len(["hello",2, 4, 6])
Error
6
4
full
empty
init
axes
degree
cordinate
points
numpy.maximum()
numpy.arraymax()
numpy.amax()
numpy.big()
Number of Rows and Column in array
Size of each items in array
Number of elements in array
Largest element of an array
What is a correct syntax to print the number 8 from the array below:
arr = np.array([[1,2,3,4,5], [6,7,8,9,10]])
print(arr[3,0])
print(arr[1,2])
print(arr[7,2])
None of The Above
What is the output of following code ?
a = np.array([[1,2,3],[4,5,6]])print(a.shape)
(2,3)
(3,2)
(1,1)
none of these
Size, shape
memory consumption
data type of array
All of these
What is the datatype of x ?
import numpy as npa=np.array([1,2,3,4])x=a.tolist()
int
array
tuple
list
To make a Matrix with all diagonal element 0
To make a Matrix with first row 0
To make a Matrix with all elements 0
import numpy as npprint(np.maximum([2, 3, 4], [1, 5, 2]))
[1 5 2]
[1 5 4]
[2 3 4]
[2 5 4]
import numpy as npa = np.array( [2, 3, 4, 5] )b = np.arange(4)print(a+b)
[2 3 4 5]
[3 4 5 6]
[1 2 3 4]
[2 4 6 8]
import numpy as npa = np.arange(5,1)print(a)
[ ]
[1 2 3 4 5]
[5 4 3 2 1]
Which syntax would print the last 3 numbers from the array below:
print(arr[3:])
print(arr[3])
print(arr[:3])
print(arr[4:])
what will be output for the following code?
import numpy as npa=np.array([1,2,3,5,8])print(a.ndim)
To make a Matrix with all element 0
all_like
ones_like
one_alike
all of the mentioned
Filled with Zero
Filled with Blank space
Filled with random garbage value
Filled with One
from numpy import *
import numpy
import numpy as my_numpy
All of above
import numpy as npa=np.array([[1,2,3],[0,1,4]])print (a.size)
5
NumPy arrays have contiguous memory location
They are more speedy to work with
They are more convenient to deal with
import numpy as npary = np.array([1,2,3,5,8])ary = ary + 1print (ary[1])
create()
list()
tuple()
array()
print(arr[1])
print(arr,0)
print(arr,1)
None of These
How many values are generated?
import numpy as npprint(np.linspace(0, 10, 6))
11
numpy.array(list)
numpy.array(list, dtype=float)
Both a and b
What will be the output?
import numpy as npa = np.array([1,2,3])b = np.array([4,5,6])print(a+b)
[5 7 9]
[1 2 3 4 5 6]
import numpy as npa = np.array([[ 1,2,3,4], [5,6,7,8], [9,10,11,12]])print(a[2,2])
7
8
import numpy as npa = np.array([[1,2],[3,4]])print(a.shape)
(2,2)
(2,1)
89
[1,2,3,4]
[1,2,3],[3,4,5],[1,3,4]
[[2 3 5][ 4 5 6][4 5 6]]
numpy.linspace()
numpy.range()
numpy.arrange()
numpy.spaceline()
Guido van Rossum
Travis Oliphant
Wes McKinney
Jim Hugunin