For the rendered tutorials, see https://numpy.org/numpy-tutorials/.
The goal of this repository is to provide high-quality resources by the NumPy project, both for self-learning and for teaching classes with. If you're interested in adding your own content, check the Contributing section. This set of tutorials and educational materials is not a part of the NumPy source tree.
To download a local copy of the .ipynb files, you can either
clone this repository
or navigate to any of the documents listed below and download it individually.
- Learn to write a NumPy tutorial: our style guide for writing tutorials.
- Tutorial: Linear algebra on n-dimensional arrays
- Tutorial: Determining Moore's Law with real data in NumPy
- Tutorial: Saving and sharing your NumPy arrays
- Tutorial: NumPy deep learning on MNIST from scratch
- Tutorial: X-ray image processing
- Tutorial: Masked Arrays
- Tutorial: Static Equilibrium
- Tutorial: Plotting Fractals
- Tutorial: Analysing the impact of the lockdown on air quality in Delhi, India
We very much welcome contributions! If you have an idea or proposal for a new tutorial, please open an issue with an outline.
Don’t worry if English is not your first language, or if you can only come up with a rough draft. Open source is a community effort. Do your best – we’ll help fix issues.
Images and real-life data make text more engaging and powerful, but be sure what you use is appropriately licensed and available. Here again, even a rough idea for artwork can be polished by others.
The NumPy tutorials are powered by [`jupyter-book`][jb-docs] and the
[`MyST` document engine][mystmd].
See the linked documentation for further details.
[mystmd]:
Set up a development environment with the dependencies listed in
requirements.txt and site/requirements.txt.
For example, using the built-in venv module:
python -m venv np-tutorials
source np-tutorials/bin/activate
python -m pip install -r requirements.txt -r site/requirements.txtThe site can then be built with:
jupyter-book start --executeThis will execute all the notebooks and start a web server to view the rendered
content locally.
View the rendered site by opening the localhost:3000 in your preferred browser.
If you have your own tutorial in the form of a Jupyter notebook (a .ipynb
file) and you'd like to add it to the repository, follow the steps below.
Go to https://github.com/numpy/numpy-tutorials/issues and create a new issue with your proposal. Give as much detail as you can about what kind of content you would like to write (tutorial, how-to) and what you plan to cover. We will try to respond as quickly as possible with comments, if applicable.
You can use our Tutorial Style Guide to make your content consistent with our existing tutorials.
Update the environment.yml file with the dependencies for your
tutorial (only if you add new dependencies).
Update the attribution section (below) to credit the original tutorial author, if applicable.
Create a pull request. Make sure the "Allow edits and access to secrets by maintainers" option is selected so we can properly review your submission.
🎉 Wait for review!
For more information about GitHub and its workflow, you can see this document.
Building the tutorials website, which is published at https://github.com/numpy/numpy-tutorials, locally isn't necessary before making a contribution, but may be helpful:
conda env create -f environment.yml
conda activate numpy-tutorials
cd site
make htmlWhile we don't have the capacity to translate and maintain translated versions of these tutorials, you are free to use and translate them to other languages.
The following links may be useful:
- NumPy Code of Conduct
- Main NumPy documentation
- NumPy documentation team meeting notes
- NEP 44 - Restructuring the NumPy documentation
- Blog post - Documentation as a way to build Community
Note that regular documentation issues for NumPy can be found in the main NumPy
repository (see the Documentation
labels there).



