PythonTutorials.net
Toggle Menu
Home
Online Python Compiler
Tutorials
Django
Flask
Scikit-Learn
NumPy
NLTK
Pillow
Blog
All Posts
Linear Algebra with NumPy
Check your understanding of matrix operations and vectorized computations.
1. Which NumPy function is used to create an array filled with zeros?
np.empty
np.zeros
np.ones
np.arange
2. Which methods can perform matrix multiplication in NumPy? (Select all that apply)
np.dot()
np.matmul()
@ operator
np.multiply()
3. NumPy arrays are mutable objects.
True
False
4. What is the full name of the function used to compute the determinant of a matrix in NumPy (format: numpy.module.function)?
5. Given vectors a = np.array([2, 3]) and b = np.array([4, 5]), what is the result of a.dot(b)?
23
14
22
25
6. Which of the following are attributes of a NumPy ndarray? (Select all that apply)
shape
dtype
size
itemsize
7. Transposing a 1D NumPy array changes its shape.
True
False
8. What does 'ndarray' stand for in NumPy terminology?
9. Which NumPy function computes the eigenvalues and eigenvectors of a square matrix?
np.linalg.det
np.linalg.inv
np.linalg.eig
np.linalg.svd
10. When using the '+' operator with NumPy arrays, which operations are possible? (Select all that apply)
Element-wise addition of two arrays with the same shape
Matrix multiplication of two 2D arrays
Scalar addition (adding a scalar to an array)
Concatenation of two arrays
Reset
Answered 0 of 0 — 0 correct