← All courses

Beginner to intermediate

NumPy for Data Science

Build practical NumPy skills for data science: arrays, shapes, selection, vectorized calculations, statistics, files, and introductory linear algebra.

For Python learners preparing to explore, transform, and analyze numerical data

What you will learn

  • Create NumPy arrays and inspect their dimensions, shape, size, and data type.
  • Reshape arrays and explain how axes correspond to rows, columns, and reductions.
  • Select data using indices, slices, and Boolean masks while understanding views and copies.
  • Use vectorized operations, universal functions, and broadcasting instead of element-by-element Python loops.
  • Calculate summary statistics, handle numeric missing values, and standardize features.
  • Reshape, sort, combine, and edit arrays while choosing operations that fit the data.
  • Load and save numeric data, make random examples reproducible, and time notebook experiments.
  • Distinguish element-wise multiplication from matrix multiplication and solve a small linear system.

Where to use NumPy

  • Represent numerical observations as one- and multi-dimensional arrays.
  • Select, transform, summarize, and normalize numerical data.
  • Prepare array data for visualization, scientific computing, and machine-learning libraries.

What this course does not cover

  • NumPy arrays are not a replacement for labeled, mixed-type tables; use a table library when labels and heterogeneous columns are central.
  • This course introduces array-based linear algebra, but does not teach the underlying mathematics or a complete machine-learning workflow.

How to use this course

This course is a NumPy module in a data-science learning roadmap. It assumes you can read basic Python, including lists, functions, and for loops. Install NumPy in your Python environment with python -m pip install numpy, then run each example in a script, REPL, or notebook.

The chapters use the conventional import numpy as np. Work through them in order: data science workflows depend on understanding an array's shape, selecting the intended observations, and checking calculations before moving on to higher-level libraries. Examples use APIs documented in the current NumPy stable documentation; consult that documentation for details that may vary by version.

A NumPy data workflow from inspecting array shape and type through selection, transformation, and summary

The workflow image summarizes the chapter progression; the official NumPy quickstart covers array structure, shape, and operations.

Course chapters

  1. 01Arrays, shapes, and data typesCreate NumPy arrays and inspect their dimensions, shape, size, and dtype.
  2. 02Reshape arrays and reason about axesReshape compatible data and use axes to describe rows, columns, and reductions.
  3. 03Select data with indices and masksChoose array elements using indices, slices, and Boolean conditions, while avoiding accidental shared-data edits.
  4. 04Vectorized operations and broadcastingApply element-wise calculations to whole arrays and use compatible shapes without writing Python loops.
  5. 05Summaries, statistics, and missing valuesSummarize arrays along the intended axis and handle NaN values explicitly.
  6. 06Load, save, and generate dataRead simple numerical text files, save arrays efficiently, and generate reproducible samples.
  7. 07Linear algebra essentialsDistinguish element-wise operations from matrix products and solve a small linear system.
  8. 08Mini-project: prepare a numerical datasetCombine array inspection, missing-value filtering, masks, reductions, and broadcasting in a compact data-preparation workflow.
  9. 09NumPy function indexSearch common NumPy functions, attributes, and methods by name or task.

Official documentation and further reading