Learn NumPy

How this course works, what the workbench can do, and the chapter list.

This is a full NumPy course for the Swiftener NumPy editor. NumPy is already imported as np. You type in that tab, press Ctrl+Enter (or Cmd+Enter), and read the console.

You do not install Python, pip, or Jupyter. Code and uploaded files stay in your browser.

After arrays, the matplotlib course draws figures, the pandas course covers labelled tables, Learn SciPy covers scientific algorithms, and Learn SymPy covers symbols. This course stays on ndarrays.

Goal

Finish every chapter by running the copy-paste blocks in the workbench. The last chapter is a small rainfall pipeline you can reuse.

How to take the course

  1. Keep this tutorial tab and the NumPy workbench side by side.
  2. Wait until the workbench status says NumPy is ready.
  3. Copy an exercise, paste it as the whole editor, run it, then read the printed array. Each shaded block is a complete script — it does not rely on leftover variables.
  4. When a chapter asks for a file, download it from the buttons above, then click Add files in the workbench.

The workbench Snippets menu is a cheat sheet. Prefer the exercises here — they are written for this editor.

What this editor can and cannot do

  • Can: ndarrays, print, CSV / text uploads, loadtxt / savetxt, writes to /uploads, downloads.
  • Cannot: matplotlib plots, pandas DataFrames, notebooks, installing extra PyPI packages beyond what the app already loads (numpy).
  • Always print(...) a result. A bare arr at the end of the editor is not displayed the way Jupyter would.

City names in the examples are row order, not a string column: Nairobi, Mombasa, Kisumu, then Nakuru and Eldoret on the sample files.

Sample files

Download any of these from the banner, then attach them with Add files:

  • units.csv — 5 cities × products A, B, C
  • prices.csv — three product prices
  • rainfall.csv — Jan–Apr millimetres for the same cities
  • temps.txt — whitespace daily max °C (Nairobi, Mombasa, Kisumu)
  • gaps.csv — rainfall layout with missing nan cells

Chapter list

Work in order the first time. After that, jump around from the sidebar.