HomeAll tracks · pricing · account
Python11 apps · Python, SQL & data
Start free Log in
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
Subscribe to unlock this lesson.
← Pandas & NumPy 0 / 8
Loading Python, NumPy and pandas in your browser… (first time ~25 MB, then cached)

Lesson 01NumPy essentialsFoundation

Arrays: one shape, one type

A NumPy array is one block of numbers with a single dtype and a shape that says how to read it.

You’ll usenp.array · .dtype · .shape · np.arange · reshape

Watch the data move

Meet the Copper Kettle café — its sales are the data for this part of the course. Watch a plain Python list become an array, pick up a `dtype` and a `shape`, grow into a 2-D table, and get re-read with `reshape`.

The mental modelAn array is **one block of memory + one dtype + a shape**. The shape is just instructions for reading the block: change it with `reshape` and the numbers stay exactly where they were.
Why it matterspandas is built on NumPy: every DataFrame column is an array underneath. One type per array is what makes whole-column maths fast — and it is why a single stray string or `NaN` quietly changes a column’s dtype.

🧪 Change `tea` to include a decimal such as `12.5` and replay — the dtype in the second frame becomes `float64`.