Skip to content

Guide · Open source

How to use numpy-100: 100 NumPy exercises with solutions

Updated · written with AI from the project's own documentation and checked against our catalogue data

numpy-100 is a free MIT-licensed collection of 100 short NumPy exercises, each with a solution, written in Python. It suits beginners who want hands-on practice, instructors who need ready-made class material, and experienced users who want a quick refresher on NumPy idioms. By the end of this guide you will know where to read the exercises, how to run them locally or in a browser, and how to work through them effectively.

100 numpy exercisesrougier/numpy-100 · ★ 14.7k · MIT

Quick start

  1. 1Open the exercises. Go to the repository on GitHub and open 100_Numpy_exercises.md to read the exercises.
  2. 2Try the Binder version. Use the Binder link to run the exercises in an interactive notebook without any local setup.
  3. 3Clone the repository. To work locally, run git clone https://github.com/rougier/numpy-100 in your terminal.
  4. 4Install prerequisites. Make sure Python and NumPy are installed on your machine before running the exercises locally.
  5. 5Solve each exercise first. Attempt each task yourself before reading the solution to get the most practice.
  6. 6Review and revisit. Compare your answers with the solutions and redo the harder exercises later.

What is numpy-100 and who is it for?

numpy-100 is a set of 100 NumPy exercises. Each exercise is a short task, such as creating arrays, slicing data or applying operations, and each comes with a solution. The exercises were gathered from the NumPy mailing list, Stack Overflow and the NumPy documentation, and the author wrote some problems to reach the 100 total.

The stated goal is to offer a quick reference for both old and new users, and a set of exercises for teachers.

  • 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

Read the exercises online or on GitHub

The simplest way to start is to open the exercises in your browser. The repository provides the exercises as a Markdown file, 100_Numpy_exercises.md, which you can read directly on GitHub.

  • Open the repository page and select 100_Numpy_exercises.md to read the exercises.
  • Use the Binder link to test the exercises in an interactive notebook without installing anything locally.

Run the exercises locally

To work on the exercises on your own computer, first clone the repository. You need Python and NumPy installed, since these are the prerequisites for running the exercises locally.

The README also explains that the Markdown and notebook files are generated from the source file source/exercises.ktx. If you want to change the content, edit the text in that source file and run the generators.py module with the libraries listed in requirements.txt installed.

  • Prerequisites: Python and NumPy
  • Repository files mentioned: 100_Numpy_exercises.md, source/exercises.ktx, generators.py, requirements.txt
git clone https://github.com/rougier/numpy-100

Work through the exercises effectively

Each exercise is a small, focused task. Try to solve it yourself before opening the solution. This is the main way the collection is meant to be used: learning by solving small problems.

Because the exercises cover a range of common operations, revisit them when you need a reminder of a NumPy idiom. Use them as a quick reference when you are stuck on a specific task.

  • Read the exercise and attempt a solution without looking at the answer.
  • Compare your solution with the provided one and note any differences.
  • Return to exercises you found hard and redo them later.

Use numpy-100 for teaching

The exercises are also designed as a set of problems for those who teach. Instructors can assign them directly from the repository without writing their own problem sets.

The README points to a separate guide, From Python to NumPy, for extended exercises and longer explanations.

  • Assign selected exercises as homework or in-class practice
  • Use the Binder link so students can run the exercises in a browser

Know the limits and find other resources

numpy-100 is a set of exercises, not a full tutorial. It does not explain NumPy from the ground up. For that, the README recommends From Python to NumPy. It is also not software you install to build applications.

The repository notes a Julia version, 100 Julia Exercises, and the From Python to NumPy guide is listed among comparable projects.

  • Not a full NumPy course: use From Python to NumPy for extended material
  • Not a library for application code: it is a collection of exercises
  • Julia alternative: 100 Julia Exercises

What people use it for

  • Practising array creation and slicing for a data science course
  • Running a NumPy warm-up session in a classroom using the exercises
  • Refreshing NumPy idioms before a project in Python
  • Working through small problems to build confidence with array operations

Frequently asked questions

Is numpy-100 free?

Yes. The repository is licensed under the MIT license, and the README states that the work is licensed under MIT.

How do I install numpy-100?

There is no installation for reading the exercises. Open the repository on GitHub, or clone it with git clone https://github.com/rougier/numpy-100 if you want a local copy. Running the exercises locally requires Python and NumPy.

What do I need to run numpy-100?

You can read the exercises in a browser with no setup. To run them locally, you need Python and NumPy. The Binder link lets you test the exercises without installing anything.

Is numpy-100 a good way to learn NumPy from scratch?

It is best as practice after you know the basics. The README says it is a set of exercises and a quick reference, not a full tutorial. For extended explanations, the README recommends From Python to NumPy.

Are there alternatives to numpy-100?

The README lists 100 Julia Exercises as a variant in another language, and From Python to NumPy as a guide for extended material. Both are useful if you want more explanation or a different language.

Can I change the exercises?

Yes, the README describes how the Markdown and notebook files are generated. You edit the text in source/exercises.ktx and run generators.py with the libraries in requirements.txt installed.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

numpy-100 is a good choice for beginners who want hands-on practice, for teachers who need ready-made problems, and for experienced users who want a quick refresher. If you need a full explanation of NumPy from the ground up, or a library to build applications, pick a tutorial such as From Python to NumPy or a software package instead.

Install options & downloads