NumPy Mastery Quiz

10:00

dtypes, reshaping, ufuncs, axes, random Generators and linear algebra. · 10 questions

Question 1 of 10
How many bytes does one `float32` value use?
Question 2 of 10
Which is the recommended way to create random numbers in modern NumPy?
Question 3 of 10
Which operator performs matrix multiplication of two NumPy arrays?
Question 4 of 10
What is the shape of `np.arange(12).reshape(3, -1)`?
Question 5 of 10
What does this print?
a = np.array([[1, 2, 3],
              [4, 5, 6]])
print(a.sum(axis=0))
Question 6 of 10
What is the difference between `np.stack([a, b])` and `np.concatenate([a, b])` for two 1-D arrays of length 3?
Question 7 of 10
Why is `np.linalg.solve(A, b)` preferred over `np.linalg.inv(A) @ b`?
Question 8 of 10
To divide each row of `m` (shape (3, 4)) by its row total, which expression is correct?
Question 9 of 10
What does this code print?
x = np.array([100, 120], dtype=np.int8)
print(x + x)
Question 10 of 10
After `v = a.reshape(2, 6)` on a contiguous 12-element array `a`, you run `v[0, 0] = 99`. What happens to `a[0]`?