Skip to main content
Loading page…
Python Mastery
Chapter 40
Lesson 4 of 4
Linear Algebra & Random
Contents
Notes
Tutor
Concept
Matrix Multiplication — @ vs * and the Mental Model
Loading activity…
Previous
1 / 11
Continue
Contents
Notes
Discussion
Tutor
26 min
11 activities
0 of 11 done
In this lesson
1
Matrix Multiplication — @ vs * and the Mental Model
2
np.linalg — Solving Systems and Decompositions
3
Random Numbers — The Modern Generator API
4
Numerical Example: Fitting a Line with Linear Algebra
5
Random Coin Flip Simulation
6
@ vs * for Matrix Multiplication
7
Linear Algebra & Random Quiz
8
np.linalg Function Reference
9
Gotcha: Using np.random.seed() in Modern Code
10
Order the Steps: Solve Ax = b with NumPy
11
Connecting NumPy to Real Problems
Objectives
Multiply matrices with the @ operator and np.dot, and distinguish dot product from element-wise multiplication
Transpose arrays with .T
Use np.linalg.solve, np.linalg.inv, and np.linalg.eig for basic linear algebra
Create a reproducible random number Generator with np.random.default_rng and a seed
Generate random integers, uniform floats, and normally-distributed samples
Chapter 40 · NumPy: Fast Numerical Computing
The ndarray
Indexing, Slicing & Vectorization
Broadcasting & Aggregation
Linear Algebra & Random
Previous: Broadcasting & Aggregation
Next: Series & DataFrame