
100 numpy exercises
A set of 100 numpy practice problems with solutions, for learning and quick reference.rougier/numpy-100
- Stars
- 14.7k
- Forks
- 7k
- Licence
- MIT
- Language
- Python
- Last update
- 14 days ago
- Type
- Learning resource
What it is
This is a collection of 100 exercises for NumPy, the Python library for working with arrays of numbers. Each exercise is a short task, such as creating arrays, slicing data or applying operations, and comes with a solution. The README says it is meant as a quick reference for new and old users and as a set of exercises for teachers.
- Work through the exercises in the Binder notebook in the browser without installing anything
- Read the markdown version of the exercises on GitHub
- Use the exercises as teaching material in a course or workshop
- Check your understanding of common NumPy operations against the provided solutions
Great for
- Beginners who want hands-on practice with NumPy
- Instructors looking for ready-made exercises for a class
- Experienced Python users who want a quick refresher on NumPy idioms
- People who prefer learning by solving small problems
Not ideal for
- People who need a full tutorial explaining NumPy from the ground up, since the README points to a separate guide, From Python to NumPy, for extended material
- Users who need NumPy-based application code or a library to install, since this is a set of exercises rather than software
How to get it
- 1
Read it online
You'll need: Python and NumPy, if you want to run the exercises locally
Clone the repository
git clone https://github.com/rougier/numpy-100 - 2
Run it
- Open the Binder link in the README to run the notebook in the browser
- Or open the markdown file 100_Numpy_exercises.md on GitHub to read the exercises
- Attempt each exercise before looking at its solution
- Check your answers by comparing with the provided solution
- 3
Get the most out of it
- Pair the exercises with the From Python to NumPy guide mentioned in the README for deeper explanations
- Use the Julia variant listed in the README if you want to compare with another language
- Work through the notebook in order, since the exercises build on earlier ones
Downloads
Strengths
- Covers 100 problems, drawn from the NumPy mailing list, Stack Overflow and the NumPy documentation, plus some original ones
- Can be run in the browser through Binder, so no local setup is needed
- Released under the MIT license, so it is free to reuse
Trade-offs
- The README is truncated, so the exact topic breakdown and solution quality could not be verified here
- The source is generated from a custom key-value text file, so editing requires running the generator script with the listed requirements
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| numpy-100 (this) | 14.7k | Learning resource | beginner | 14 days ago | Beginners who want hands-on practice with NumPy |
| PythonDataScienceHandbook | 50.3k | Learning resource | beginner | 2.4 years ago | Students learning NumPy, Pandas, Matplotlib, or Scikit-Learn through hands-on examples |
| cheatsheets-ai | 15.4k | Learning resource | beginner | 7.1 years ago | Students who want a one-page summary of a library's main functions |
| rustlings | 64.5k | Learning resource | beginner | 11 days ago | People learning Rust for the first time |
| tutorials | 13.1k | Learning resource | beginner | 5.9 years ago | Chinese-speaking beginners who want a guided introduction to machine learning |
| PRML | 11.7k | Learning resource | beginner | 1.6 years ago | Students studying the Bishop PRML book who want runnable code for each chapter |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.