Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What operation do you use to add two NumPy arrays?
Think of basic arithmetic.
How do you square each element in a NumPy array?
It’s like raising to a power.
What does the + operator do on NumPy arrays?
Think of it like regular addition.
True or False: np.array([1, 2, 3]) ** 2 results in np.array([1, 2, 3, 4]).
Remember what squaring means.
Suppose you have two arrays, a = np.array([1, 3, 5]) and b = np.array([2, 4, 6]). Write a piece of code to perform and print the results of their addition, multiplication, and element-wise square of array a.
Combine the operations in a single script.
Explain how using NumPy’s array operations would change if you were to compute predictions using a large dataset instead of just two arrays.
Think about performance and time efficiency.
5 more questions in this section. Enroll free to practise them all.
Enroll free