Filled with Zero
Filled with Blank space
Filled with random garbage value
Filled with One
shape, dtype, ndim
objects, type, list
objects, non vectorization
Unicode and shape
full
empty
init
None of these
Array
List
Matrix
Tuple
numpy.array(list)
numpy.array(list, dtype=float)
Both a and b
None of the above
Numbering Python
Number in Python
Numerical Python
Number for Python
What will be output for the following code?
import numpy as npa=np.array([[1,2,3],[0,1,4]])print (a.size)
1
5
6
4
What will be the output of the following ?
import numpy as npa = np.arange(5,1)print(a)
[ ]
[1 2 3 4 5]
[5 4 3 2 1]
[1 2 3 4]
import numpy as npary = np.array([1,2,3,5,8])ary = ary + 1print (ary[1])
0
2
3
import numpy as npa = np.arange(1,5,2)print(a)
[1 3 5]
[1 3]
[1,3]
[1,2,3,4,5]
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
21
22
ndarray
narray
nd_array
darray
Guido van Rossum
Travis Oliphant
Wes McKinney
Jim Hugunin
A machine learning library
A web development framework
A numerical computing library in Python
A data visualization tool
import numpy as npa=np.array([2,4])b=np.array([3,5])c=a*bprint(c)
[ 2 4 3 5]
[ 6 20]
[ 6 12 10 20]
26
Shape
both a) and b)
None of the above.
What is the output of the following code?
import numpy as npa = np.array([1,2,3,5,8])b = np.array([0,1,5,4,2])c = a + bc = c*aprint (c[2])
24
Number In Python
To make a Matrix with all element 0
To make a Matrix with all diagonal element 0
To make a Matrix with first row 0
import numpy as npa = np.array([[ 1,2,3,4], [5,6,7,8], [9,10,11,12]])print(a[2,2])
7
11
10
8
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]
[2 4 6 8]
It creates a new Python list.
It creates a NumPy array.
It performs element-wise addition.
It calculates the mean of an array.
all_like
ones_like
one_alike
all of the mentioned
the shape is the number of rows
the shape is the number of columns
the shape is the number of element in each dimension
Total number of elements in array
What will be the output of the following Python code?
len(["hello",2, 4, 6])
Error
Web development
Machine learning and scientific computing
Game development
Database management
import numpy as npa=np.array([2,4,1])b=aa[1]=3print(b)
[2 4 1]
[3 4 1]
[2 3 1]
[2 4 3]
What will be output for the following code ?
import numpy as npa=np.array([2,3,4,5])print(a.dtype)
int32
int
float
none of these
np.array()
np.zeros()
np.empty()
All of the above
NumPy arrays have contiguous memory location
They are more speedy to work with
They are more convenient to deal with
arr=np.array([1,2,3,4],dtype='float')
arr=np.array([1,2,3,4],dtype='f')
arr=np.array([1,2,3,4],dtype=float)
make a matrix with first column 0
make a matrix with all elements 0
make a matrix with diagonal elements 0
integer
string
boolean
Number of Rows and Column in array
Size of each items in array
Number of elements in array
Largest element of an array
numpy.linspace()
numpy.range()
numpy.arrange()
numpy.spaceline()
rank
dtype
shape
np.concatenate()
np.join()
np.array_join()
np.join_array()
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)
array_split()
split()
split_array()
hstack() and vstack()
import numpy as np
ary=np.array([1,2,3,5,8])
ary=ary+1
print(ary[1])
import numpy as npa = np.array([[1, 2, 3],[0,1,4],[11,22,33]])print (a.size)
9
import numpy as npa = np.array([1, 5, 4, 7, 8])a = a + 1print(a[1])
print(arr[1])
print(arr,0)
print(arr,1)
None of These
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])
12
28
from numpy import *
import numpy
import numpy as my_numpy
All of above
89
[1,2,3,4]
[1,2,3],[3,4,5],[1,3,4]
[[2 3 5][ 4 5 6][4 5 6]]
Indexed
Sliced
Iterated
All of the mentioned above
Size, shape
memory consumption
data type of array
All of these
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])
What will be the output of the following code?
import numpy as npa=np.array([1,2,3])print(a.ndim)