Scientific Python Lectures¶
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: 2024.2rc0.dev0
- 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. NumPy: creating and manipulating numerical data
- 1.3.1. The NumPy array object
- 1.3.2. Numerical operations on arrays
- 1.3.3. More elaborate arrays
- 1.3.4. Advanced operations
- 1.3.5. Some exercises
- 1.3.6. Full code examples
- 1.4. Matplotlib: plotting
- 1.4.1. Introduction
- 1.4.2. Simple plot
- 1.4.2.1. Plotting with default settings
- 1.4.2.2. Instantiating defaults
- 1.4.2.3. Changing colors and line widths
- 1.4.2.4. Setting limits
- 1.4.2.5. Setting ticks
- 1.4.2.6. Setting tick labels
- 1.4.2.7. Moving spines
- 1.4.2.8. Adding a legend
- 1.4.2.9. Annotate some points
- 1.4.2.10. Devil is in the details
- 1.4.3. Figures, Subplots, Axes and Ticks
- 1.4.4. Other Types of Plots: examples and exercises
- 1.4.5. Beyond this tutorial
- 1.4.6. Quick references
- 1.4.7. Full code examples
- 1.5. SciPy : high-level scientific computing
- 1.5.1. File input/output:
scipy.io
- 1.5.2. Special functions:
scipy.special
- 1.5.3. Linear algebra operations:
scipy.linalg
- 1.5.4. Interpolation:
scipy.interpolate
- 1.5.5. Optimization and fit:
scipy.optimize
- 1.5.6. Statistics and random numbers:
scipy.stats
- 1.5.7. Numerical integration:
scipy.integrate
- 1.5.8. Fast Fourier transforms:
scipy.fft
- 1.5.9. Signal processing:
scipy.signal
- 1.5.10. Image manipulation:
scipy.ndimage
- 1.5.11. Summary exercises on scientific computing
- 1.5.11.1. Maximum wind speed prediction at the Sprogø station
- 1.5.11.2. Non linear least squares curve fitting: application to point extraction in topographical lidar data
- 1.5.11.3. Image processing application: counting bubbles and unmolten grains
- 1.5.11.4. Example of solution for the image processing exercise: unmolten grains in glass
- 1.5.12. Full code examples for the SciPy chapter
- 1.5.1. File input/output:
- 1.6. 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
- 2.2.5. Summary
- 2.2.6. Contributing to NumPy/SciPy
- 2.3. Debugging code
- 2.4. Optimizing code
- 2.5. Sparse Arrays 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. Importing
- 3.3.3. Example data
- 3.3.4. Input/output, data types and colorspaces
- 3.3.5. Image preprocessing / enhancement
- 3.3.6. Image segmentation
- 3.3.7. Measuring regions’ properties
- 3.3.8. Data visualization and interaction
- 3.3.9. Feature extraction for computer vision
- 3.3.10. Full code examples
- 3.3.11. Examples for the scikit-image chapter
- 3.4. scikit-learn: machine learning in Python
- 3.4.1. Introduction: problem settings
- 3.4.2. Basic principles of machine learning with scikit-learn
- 3.4.3. Supervised Learning: Classification of Handwritten Digits
- 3.4.4. Supervised Learning: Regression of Housing Data
- 3.4.5. Measuring prediction performance
- 3.4.6. Unsupervised Learning: Dimensionality Reduction and Visualization
- 3.4.7. Parameter selection, Validation, and Testing
- 3.4.8. Examples for the scikit-learn chapter
- 3.1. Statistics in Python