This hands-on course introduces array-based scientific computing in Python. Participants work interactively in Jupyter notebooks, using NumPy to represent and transform numerical data, Matplotlib to visualize results, and SciPy for scientific calculations, curve fitting, and statistics.

The course progresses from numerical analysis to signals and multidimensional image data, then develops an understanding of the objects and methods used by scientific Python libraries. The final session connects in-memory arrays to structured scientific files and labeled datasets, with practical approaches to controlling memory use.

Course Outline

The course meets weekly, with each session lasting 3.5 hours and no additional assignments, for a total workload of 14 hours.

Session 1: Numerical Analysis and Visualization

Get started with interactive coding in Jupyter notebooks. Work with core Python data collections, create NumPy arrays, and apply functions to numerical data. Visualize results with Matplotlib, fit curves and evaluate models with NumPy and SciPy, and explore statistical methods with SciPy-Stats.

Session 2: Signals, Images, and Array Operations

Generate scientific signals with SciPy and plot them with Matplotlib. Learn how indexing, slicing, and masking select and modify parts of arrays, and apply these techniques to multidimensional image data. Explore interactive image viewing and masking with napari.

Session 3: Python Objects and Library Interfaces

Develop an understanding of Python types, objects, and methods, and how they appear in scientific library interfaces. Explore how different kinds of data are stored and modified, and practice working with strings and their methods. Use Matplotlib’s figure and axes objects to build and customize plots.

Session 4: Memory, Files, and Labeled Arrays

Understand and control memory usage when working with NumPy arrays. Explore how scientific data is organized, accessed, and compressed in HDF5 files, and use Xarray to work with labeled multidimensional datasets. Introduce chunk-based analysis with Xarray and Dask to reduce memory requirements.

Optional extensions include a closer look at NumPy memory behavior and working with Neurodata Without Borders (NWB) files using PyNWB and h5py.

Learning and participation

Topics

  • Numerical Analysis and Visualization: Python data collections, NumPy arrays and functions, Matplotlib, curve fitting, model evaluation, and SciPy statistics.
  • Signals and Image Arrays: Signal generation with SciPy, array indexing, slicing and masking, image visualization, and interactive masking with napari.
  • Python Objects and Scientific Libraries: Types, objects, methods, storing and modifying data, strings, and Matplotlib's object-based interface.
  • Memory and Structured Scientific Data: NumPy memory usage, HDF5 storage and compression, labeled arrays with Xarray, and an introduction to chunk-based analysis with Dask.

Intended participants

  • Researchers and students from all universities are welcome.
  • Familiarity with basic Python syntax, variables, and function calls is helpful, but not required.
  • No prior experience with NumPy, Matplotlib, SciPy, or Xarray is required.

Certification

Participants who attend at least 75% of the course will receive a participation certificate by email at the end of the course.