numpy-100
100 numpy exercises (with solutions)
A collection of 100 hands-on NumPy exercises with solutions for practicing numerical computing in Python, useful as a self-study course, a quick reference, or ready-made classroom material.
This repository is a set of 100 practice exercises for NumPy, a widely used add-on library for the Python programming language. NumPy is the standard tool for working with numbers in bulk, such as large tables and grids of data, and it is a foundation for much of the data science and scientific computing done in Python. The exercises are meant to help people learn and practice it through small, concrete problems.
The author gathered the problems from several sources, including the NumPy mailing list, the question-and-answer site Stack Overflow, and the official NumPy documentation, then wrote some additional problems to round the collection out to one hundred. According to the README, the collection has two purposes: to act as a quick reference for both new and experienced users, and to give teachers a ready-made set of exercises to use with students. The exercises come with solutions.
There are a few ways to use the material. You can run the exercises interactively in your browser through a service called Binder, which sets up a working environment for you without any installation, or you can simply read them as a document on GitHub. For people who want to go further, the README links to a longer companion text called From Python to NumPy.
The README also explains how the project is put together for anyone who wants to contribute. The exercise content is not edited directly in the finished files. Instead, the source text lives in a single file written in a simple key-and-value format the author calls keyed text, and a Python script then generates both the Markdown version and the notebook version from that source. To change an exercise, you edit the source file and rerun that script.
The work is released under the MIT license, and the README notes that a separate version of the exercises exists for the Julia programming language.
Where it fits
- Work through 100 progressively challenging exercises to build NumPy skills from scratch.
- Use the exercise set as ready-made course material for a Python data science class.
- Run the exercises interactively in a browser via Binder with no local installation required.
- Use the collection as a quick reference cheat sheet for common NumPy operations and patterns.