What does NumPy stand for?
A
Number Python B
Numeric Python C
Numerous Python D
Num Program
Analysis & Theory
NumPy stands for 'Numerical Python'.
Which command is used to install NumPy?
A
pip get numpy B
python install numpy C
pip install numpy D
install numpy
Analysis & Theory
Use `pip install numpy` to install NumPy.
What is the common alias used when importing NumPy?
A
import numpy as n B
import numpy as np C
import numpy as num D
import np as numpy
Analysis & Theory
By convention, NumPy is imported as `np`.
What data structure does NumPy primarily work with?
A
List B
Tuple C
ndarray D
Set
Analysis & Theory
NumPy uses an n-dimensional array object called `ndarray`.
What will `np.zeros((2, 2))` create?
A
A 2x2 array of ones B
A 1D array with 2 zeros C
A 2x2 array of zeros D
An error
Analysis & Theory
`np.zeros((2, 2))` creates a 2x2 array filled with zeros.
Which method gives the number of dimensions of a NumPy array?
A
array.size B
array.ndim C
array.shape D
array.type
Analysis & Theory
`array.ndim` returns the number of dimensions.
What is the result of `np.arange(0, 5, 2)`?
A
[0, 1, 2, 3, 4] B
[0, 2, 4] C
[1, 3, 5] D
[0, 5, 2]
Analysis & Theory
`np.arange(0, 5, 2)` returns evenly spaced values: [0, 2, 4].
What does `A.T` represent for a NumPy array `A`?
A
Transpose of A B
Type of A C
Total of A D
Time of A
Analysis & Theory
`A.T` gives the transpose of matrix `A`.
Which function is used for matrix multiplication in NumPy?
A
np.multiply() B
np.matmult() C
np.dot() D
np.product()
Analysis & Theory
`np.dot()` is used for matrix multiplication.
Why is NumPy faster than regular Python lists?
A
It uses less memory B
It has optimized C implementations C
It avoids type checking at runtime D
All of the above
Analysis & Theory
All the listed reasons contribute to NumPy's high performance.