Scientific Python: NumPy, SciPy and Matplotlib

Scientists rarely lack maths, they lack the tools to turn it into fast, reproducible code. We learn to think in arrays rather than loops, reach for the right SciPy function instead of rewriting it, and produce figures you can put straight into a paper.

Duration: 3 days · Level: intermediate

For: scientists, engineers and researchers processing measurements, simulations or experimental data.

Prerequisites: knowing the basics of Python, and the maths of your own field.

Scientific Python: NumPy, SciPy and Matplotlib

Day 1 — Thinking in arrays

  • Jupyter as a lab notebook
  • NumPy arrays: shape, dtype and memory
  • Indexing, slicing and boolean masks
  • Vectorisation: goodbye loops
  • Broadcasting: the rules that surprise everyone
  • Universal functions and aggregations
  • Views vs copies: don't get surprised by mutability
  • Random numbers and reproducibility
  • Linear algebra with numpy.linalg

Day 2 — The SciPy toolbox

  • Statistics and tests with scipy.stats
  • Fitting models with scipy.optimize
  • Interpolating with scipy.interpolate
  • Filtering and spectra with scipy.signal
  • Integrating and solving ODEs
  • Sparse matrices
  • Physical units and constants
  • Choosing between writing it and finding it

Day 3 — Big data and nice figures

  • Matplotlib: figures, axes and the object API
  • Publication-ready figures: styles, sizes, fonts
  • Multi-panel figures and colour maps
  • Data too big for memory: memory maps
  • Reading netCDF and HDF5 files
  • Calling C and Fortran code from Python
  • Profiling and speeding up with numba
  • Reproducibility: uv, locked versions, notebooks to scripts

Elevate Your Python Proficiency!