Read this lesson as text
NumPy Crash Course
Linear Algebra for Machine Learning · Axiom Academy
Master the fundamentals of numerical computing in Python Use np.array() for converting lists, np.zeros/ones for quick initialization, np.arange/linspace for sequences, and np.random for generating random values. Shape is (rows, columns) for 2D arrays. The first dimension is always rows, the second is columns. This matters when doing matrix operations! Slicing uses [start:stop:step]. Remember: stop is exclusive, so a[1:4] gets elements at indices 1, 2, 3. * is element-wise multiplication, @ or np.matmul() is matrix multiplication. np.dot() with 2D arrays is the same as @ but works differently with 1D arrays.
This is the written version of the interactive lesson above. See the full Linear Algebra for Machine Learning course.