Scientific Computing
NumPy and Linear Algebra
Цели урока
- Understand ndarray as a homogeneous contiguous-memory array and why it beats Python lists
- Apply broadcasting correctly and predict the shape of the result
- Use np.linalg for solving systems, SVD, eigenvalues; know when NOT to use inv()
- Replace Python loops with vectorized operations and understand the speedup through BLAS/LAPACK
Предварительные знания
The ECMWF climate model processes 100 TB of data every day for weather forecasting. NumPy is the foundation of PyTorch, TensorFlow, and pandas. scipy.linalg runs Fortran LAPACK under the hood. CERN's Large Hadron Collider: 15 petabytes per year through the ROOT framework. A 10,000 x 10,000 matrix? One line of NumPy - seconds. Three nested Python loops - hours.
- **PyTorch and TensorFlow** - Tensor = ndarray + autograd; all of deep learning is built on NumPy broadcasting and matmul semantics
- **ECMWF weather forecast** - 100 TB daily, NumPy/SciPy for post-processing; 10-day forecast accuracy doubled over 20 years
- **CERN ROOT framework** - 15 PB/year; Python bindings via NumPy arrays for particle physics analysis
- **NumPy SVD in recommendations** - Netflix Prize 2009 was won through matrix factorization; np.linalg.svd in 3 lines
- **Scipy LAPACK** - the same Fortran code used in aerospace engineering and CFD simulations since the 1980s, now in pip install scipy