Mathematical and logical operations on arrays.
Fourier transforms and routines for shape manipulation.
Operations related to linear algebra.
All of the above
ndarray
narray
nd_array
darray
np.array([4,5,6])
np.create_array([4,5,6])
np.createArray([4,5,6])
np.numpyArray([4,5,6])
89
[1,2,3,4]
[1,2,3],[3,4,5],[1,3,4]
[[2 3 5][ 4 5 6][4 5 6]]
np.ndim(array_name)
array_name.ndim()
np.dim(array_name)
array_name.dim
print(arr[1])
print(arr,0)
print(arr,1)
None of These
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 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])
Which syntax would print the last 3 numbers from the array below:
print(arr[3:])
print(arr[3])
print(arr[:3])
print(arr[4:])
Which syntax would print every other item from the array below:
print(arr[1:3:5:7])
print(arr[::2])
print(arr(0:step=2))
print(arr[2:2:2])
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])
arr=np.array([1,2,3,4],dtype='f')
arr=np.array([1,2,3,4],dtype=float)
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
np.concatenate()
np.join()
np.array_join()
np.join_array()
array_split()
split()
split_array()
hstack() and vstack()
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])
0
1
2
3
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])
18
20
21
22
np.array()
np.zeros()
np.empty()
shape, dtype, ndim
objects, type, list
objects, non vectorization
Unicode and shape
make a matrix with first column 0
make a matrix with all elements 0
make a matrix with diagonal elements 0