NumPy - Array Operations
Given two arrays:
What is the result of
a = np.array([[1, 2], [3, 4]]) b = np.array([10, 20])
What is the result of
a + b and why?a = np.array([[1, 2], [3, 4]]) b = np.array([10, 20])
a + b and why?a is shape (2,2), b is shape (2,). Numpy broadcasts b across rows of a.b to each row of a: first row [1+10, 2+20], second row [3+10, 4+20].15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions