SigmaAnalytics & Tech
B1PythonBeginnerAbout 120 min to complete

Introduction to NumPy

The array — the single data structure underneath pandas, scikit-learn, and every scientific Python library.

Notebook

About 120 minutes to complete

Enrol to read the notebook and download it to run.

What this module covers

The array — the single data structure underneath pandas, scikit-learn, and every scientific Python library.

By the end of it

  • Explain why NumPy is fast, in terms of memory layout and typed storage
  • Create arrays with array, zeros, ones, arange, linspace, full, and eye
  • Inspect arrays via shape, ndim, size, dtype, itemsize, and nbytes
  • Choose dtypes deliberately, and recognise integer overflow and precision loss
  • Index and slice 1-D and multi-dimensional arrays with [row, col] syntax
  • Distinguish views from copies — the single most important NumPy gotcha
  • Reshape arrays with reshape, ravel, flatten, and .T, and explain -1
  • Measure the memory and speed difference against Python lists