Key Ideas
1From Theory to Code. Lessons 2.1 through 2.4 covered vectors, matrices, dot products, norms, multiplication, and eigenvalues on paper. This lab puts every one of those ideas into actual ru...
2Creating Vectors and Matrices. import numpy as np # A vector — just a 1D array house = np.array([1800, 3, 2, 15]) print(house.shape) # (4,) — matches what Lesson 2.1 predicted # A matrix — 100 house...
3Dot Products and Norms in Code. a = np.array([2, 3, 1]) b = np.array([4, 0, 5]) # Dot product — matches Lesson 2.2's worked example exactly dot_result = np.dot(a, b) print(dot_result) # 13 # L2 norm ...
4Eigenvalues, One Line. A = np.array([[4, 2], [1, 3]]) eigenvalues, eigenvectors = np.linalg.eig(A) print("Eigenvalues:", eigenvalues) print("Eigenvectors:", eigenvectors) This is genuinely a...
5Lab Exercise. Before moving to Module 3, try this on your own: