0Pricing
Learn AI with Python · Lesson

Linear Algebra with NumPy

np.dot, np.linalg.inv, np.linalg.eig, np.linalg.solve for systems of equations.

Linear Algebra in NumPy

NumPy provides matrix operations through the @ operator and the np.linalg module, the foundation of nearly every machine learning algorithm.

Matrix Multiplication with @

The @ operator performs true matrix multiplication. Inner dimensions must match: (m,k) @ (k,n) gives (m,n).

import numpy as np
A = np.array([[1, 2], [3, 4]])
B = np.array([[5, 6], [7, 8]])
print(A @ B)
# [[19 22]
#  [43 50]]

All lessons in this course

  1. Array Creation and Properties
  2. Indexing, Slicing, and Fancy Indexing
  3. Broadcasting and Vectorized Operations
  4. Linear Algebra with NumPy
← Back to Learn AI with Python