rougier / numpy-100

100 numpy exercises (with solutions)
MIT License
12.05k stars 5.7k forks source link

I have a better way to solve exercise 24 #216

Open anthonyduong9 opened 6 days ago

anthonyduong9 commented 6 days ago

I think

Z = np.matmul(np.ones((5, 3)), np.ones((3, 2)))

would be better than

https://github.com/rougier/numpy-100/blob/916e1ecf9544719b49ece6fc135b089988b33058/100_Numpy_exercises_with_hints_with_solutions.md?plain=1#L205

because the docs say

"If both a and b are 2-D arrays, it is matrix multiplication, but using matmul or a @ b is preferred.".