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
np.concatenate()
np.join()
np.array_join()
np.join_array()
What will be the output?
import numpy as npa = np.array([[1,2],[3,4]])print(a.shape)
(4,)
(2,2)
(2,1)
4
Web development
Machine learning and scientific computing
Game development
Database management
change in shape of array
reshaping of array
get the shape of the array
All of above
array_split()
split()
split_array()
hstack() and vstack()
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
21
22
[1,3,5,7,9]
[1,2,3,4,5]
[2,4,6,8]
Error
Indexing
Slicing
Reshaping
None of the above
ndarray
narray
nd_array
darray
numpy.array(list)
numpy.array(list, dtype=float)
Both a and b
Indexed
Sliced
Iterated
All of the mentioned above
range()
space()
arange()
linspace()
2 rows, 3 columns of ones
3 rows, 2 columns of ones
6×6 matrix
1D array
Tuple of array dimensions
Total elements
Data type
Memory size
Array
List
Matrix
Tuple
It creates a new Python list.
It creates a NumPy array.
It performs element-wise addition.
It calculates the mean of an array.
from numpy import *
import numpy
import numpy as my_numpy
Numbering Python
Number in Python
Numerical Python
Number for Python
Filled with Zero
Filled with Blank space
Filled with random garbage value
Filled with One
Size, shape
memory consumption
data type of array
All of these
Number In Python
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])
A machine learning library
A web development framework
A numerical computing library in Python
A data visualization tool
import numpy as npary = np.array([1,2,3,5,8])ary = ary + 1print (ary[1])
0
1
2
3
list
tuple
dictionary
What will be output for the following code ?
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([2,4])b=np.array([3,5])c=a*bprint(c)
[ 2 4 3 5]
[ 6 20]
[ 6 12 10 20]
26
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
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
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]
import numpy as np
ary=np.array([1,2,3,5,8])
ary=ary+1
print(ary[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:])
np.create()
np.array()
np.ndarray()
np.makearray()
float
integer
string
boolean
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]
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
12
28
np.array([4,5,6])
np.create_array([4,5,6])
np.createArray([4,5,6])
np.numpyArray([4,5,6])
Shape
both a) and b)
None of the above.
import numpy as npprint(np.maximum([2, 3, 4], [1, 5, 2]))
[1 5 2]
[1 5 4]
[2 3 4]
[2 5 4]
axes
degree
cordinate
points
We can find the dimension of the array
Size of array
Operational activities on Matrix
None of the mentioned above
Mathematical and logical operations on arrays.
Fourier transforms and routines for shape manipulation.
Operations related to linear algebra.
All of the above
create()
list()
tuple()
array()
import numpy as npa=np.array([[1,2,3],[0,1,4]])print (a.size)
5
6
full
empty
init
None of these
import numpy as npa=np.array([2,4,1])b=a.copy()a[1]=3print(b)
import numpy as npa = np.array([[ 1,2,3,4], [5,6,7,8], [9,10,11,12]])print(a[2,2])
7
11
8
import numpy as npa = np.arange(5,1)print(a)
[ ]
[1 2 3 4 5]
[5 4 3 2 1]
np.ndim(array_name)
array_name.ndim()
np.dim(array_name)
array_name.dim