Skip to content
Learn Python with BNHR

Module 2 · Beginner

Arrays with NumPy

Module 2 of Arrays & DataFrames: arrays, their dtype and shape, masks, vectorized arithmetic and broadcasting, and sums along an axis with missing values. Its sections, its notebooks to read on the web, and the companion's solutions and explanations.

Module 2Level Beginner
On this page
  1. Overview
  2. What you do
  3. The module’s notebooks
  4. Certification and support

A column of a table is an array underneath: thousands of values of one type, worked on all at once. This module takes the survey’s plot areas, harvests and prices as NumPy arrays and does without loops what Python Essentials did with them: converting square meters to hectares, computing yields, picking out the irrigated rice plots with a mask, and averaging prices across provinces or across months, with a month missing.

  1. Creating arrays; dtype and shape
  2. Indexing, slicing and boolean masks
  3. Vectorized arithmetic and broadcasting
  4. Aggregating along an axis; NaN

The notebooks are in your course folder; here you can read them without running anything. For reference in any module: primer: marimo and the python this course assumes and primer: pandas 2 to 3 and glossary.

Saved in this browser only

Certification and support

We offer additional resources, certificates, ongoing support, and other perks to those who join our instructor-led training.

Join an upcoming training to take this as an instructor-led course, or contact us to arrange one for your team or organization.

Something new

Identify results
LayerExplore a module
ModuleStart here
AboutModule 1 of Python for Data Management: your laptop ready, how a marimo notebook works, and a refresher of the Python the course uses. Its sections, its notebooks to read on the web, and the companion's solutions and explanations.
CoursePython for Data Management, free