NumPy: final assessment

This covers the whole course. Take it after the last module.

Final quiz

1. What does a.shape give for a 3 × 4 array?
2. What is np.zeros(3).dtype?
3. What does a[-1] give for a 1-D array?
4. What is np.array([1, 2, 3]).sum()?
5. Which operator is matrix multiplication in NumPy?
6. Shapes (4, 1) and (3,) broadcast to…
7. After b = a.copy(); b[0] = 5, what is a[0]?
8. What is (np.array([1, 5, 3]) > 2).sum()?
9. m has shape (3, 4). What is m.mean(axis=0).shape?
10. What does np.unique([2, 1, 2]) return?
11. Which reshape fails for an array of 10 elements?
12. Why is np.linalg.solve preferred to inv(A) @ b?
13. x of shape (5,) needs to become a column. Which works?
14. np.array([200], dtype=np.uint8) + np.uint8(100) gives…
15. A function sets every value of a slice it receives to 0. The caller's array…
16. Which expression standardises each column of X?

Practical assessment: A weather data analysis

Without using hints, analyse a days × cities temperature array with NumPy: summaries, anomalies, rankings and a simple trend, with no Python loops over the data.

Final project

A grade analytics toolkit: Analyse a class's marks stored as a students × subjects array: totals, averages, rankings, standardised scores and a grade histogram, all without Python loops over the data.

How it is evaluated

To complete this course