Scipy Lecture Notes¶
One document to learn numerics, science, and data with Python¶
Tutorials on the scientific Python ecosystem: a quick introduction to central tools and techniques. The different chapters each correspond to a 1 to 2 hours course with increasing level of expertise, from beginner to expert.
Release: 2022.1
- 1. Getting started with Python for science
- 1.1. Python scientific computing ecosystem
- 1.2. The Python language
- 1.2.1. First steps
- 1.2.2. Basic types
- 1.2.3. Control Flow
- 1.2.4. Defining functions
- 1.2.5. Reusing code: scripts and modules
- 1.2.6. Input and Output
- 1.2.7. Standard Library
- 1.2.8. Exception handling in Python
- 1.2.9. Object-oriented programming (OOP)
- 1.3. Python 2 and Python 3
- 1.4. NumPy: creating and manipulating numerical data
- 1.4.1. The NumPy array object
- 1.4.2. Numerical operations on arrays
- 1.4.3. More elaborate arrays
- 1.4.4. Advanced operations
- 1.4.5. Some exercises
- 1.4.6. Full code examples
- 1.5. Matplotlib: plotting
- 1.5.1. Introduction
- 1.5.2. Simple plot
- 1.5.2.1. Plotting with default settings
- 1.5.2.2. Instantiating defaults
- 1.5.2.3. Changing colors and line widths
- 1.5.2.4. Setting limits
- 1.5.2.5. Setting ticks
- 1.5.2.6. Setting tick labels
- 1.5.2.7. Moving spines
- 1.5.2.8. Adding a legend
- 1.5.2.9. Annotate some points
- 1.5.2.10. Devil is in the details
- 1.5.3. Figures, Subplots, Axes and Ticks
- 1.5.4. Other Types of Plots: examples and exercises
- 1.5.5. Beyond this tutorial
- 1.5.6. Quick references
- 1.5.7. Full code examples
- 1.6. Scipy : high-level scientific computing
- 1.6.1. File input/output:
scipy.io
- 1.6.2. Special functions:
scipy.special
- 1.6.3. Linear algebra operations:
scipy.linalg
- 1.6.4. Interpolation:
scipy.interpolate
- 1.6.5. Optimization and fit:
scipy.optimize
- 1.6.6. Statistics and random numbers:
scipy.stats
- 1.6.7. Numerical integration:
scipy.integrate
- 1.6.8. Fast Fourier transforms:
scipy.fftpack
- 1.6.9. Signal processing:
scipy.signal
- 1.6.10. Image manipulation:
scipy.ndimage
- 1.6.11. Summary exercises on scientific computing
- 1.6.11.1. Maximum wind speed prediction at the Sprogø station
- 1.6.11.2. Non linear least squares curve fitting: application to point extraction in topographical lidar data
- 1.6.11.3. Image processing application: counting bubbles and unmolten grains
- 1.6.11.4. Example of solution for the image processing exercise: unmolten grains in glass
- 1.6.12. Full code examples for the scipy chapter
- 1.6.1. File input/output:
- 1.7. Getting help and finding documentation
- 2. Advanced topics
- 2.1. Advanced Python Constructs
- 2.1.1. Iterators, generator expressions and generators
- 2.1.2. Decorators
- 2.1.2.1. Replacing or tweaking the original object
- 2.1.2.2. Decorators implemented as classes and as functions
- 2.1.2.3. Copying the docstring and other attributes of the original function
- 2.1.2.4. Examples in the standard library
- 2.1.2.5. Deprecation of functions
- 2.1.2.6. A
while
-loop removing decorator - 2.1.2.7. A plugin registration system
- 2.1.3. Context managers
- 2.2. Advanced NumPy
- 2.2.1. Life of ndarray
- 2.2.2. Universal functions
- 2.2.3. Interoperability features
- 2.2.4. Array siblings:
chararray
,maskedarray
,matrix
- 2.2.5. Summary
- 2.2.6. Contributing to NumPy/Scipy
- 2.3. Debugging code
- 2.4. Optimizing code
- 2.5. Sparse Matrices in SciPy
- 2.6. Image manipulation and processing using Numpy and Scipy
- 2.7. Mathematical optimization: finding minima of functions
- 2.7.1. Knowing your problem
- 2.7.2. A review of the different optimizers
- 2.7.3. Full code examples
- 2.7.4. Examples for the mathematical optimization chapter
- 2.7.5. Practical guide to optimization with scipy
- 2.7.6. Special case: non-linear least-squares
- 2.7.7. Optimization with constraints
- 2.7.8. Full code examples
- 2.7.9. Examples for the mathematical optimization chapter
- 2.8. Interfacing with C
- 2.1. Advanced Python Constructs
- 3. Packages and applications
- 3.1. Statistics in Python
- 3.1.1. Data representation and interaction
- 3.1.2. Hypothesis testing: comparing two groups
- 3.1.3. Linear models, multiple factors, and analysis of variance
- 3.1.4. More visualization: seaborn for statistical exploration
- 3.1.5. Testing for interactions
- 3.1.6. Full code for the figures
- 3.1.7. Solutions to this chapter’s exercises
- 3.2. Sympy : Symbolic Mathematics in Python
- 3.3. Scikit-image: image processing
- 3.3.1. Introduction and concepts
- 3.3.2. Input/output, data types and colorspaces
- 3.3.3. Image preprocessing / enhancement
- 3.3.4. Image segmentation
- 3.3.5. Measuring regions’ properties
- 3.3.6. Data visualization and interaction
- 3.3.7. Feature extraction for computer vision
- 3.3.8. Full code examples
- 3.3.9. Examples for the scikit-image chapter
- 3.4. Traits: building interactive dialogs
- 3.5. 3D plotting with Mayavi
- 3.6. scikit-learn: machine learning in Python
- 3.6.1. Introduction: problem settings
- 3.6.2. Basic principles of machine learning with scikit-learn
- 3.6.3. Supervised Learning: Classification of Handwritten Digits
- 3.6.4. Supervised Learning: Regression of Housing Data
- 3.6.5. Measuring prediction performance
- 3.6.6. Unsupervised Learning: Dimensionality Reduction and Visualization
- 3.6.7. The eigenfaces example: chaining PCA and SVMs
- 3.6.8. The eigenfaces example: chaining PCA and SVMs
- 3.6.9. Parameter selection, Validation, and Testing
- 3.6.10. Examples for the scikit-learn chapter
- 3.1. Statistics in Python