pandas foundations

Why pandas exists, Series with their index and alignment, and DataFrames with their shape, types and summaries.

About 5 hours of study

Learning objectives

Lessons

  1. 1

    Why pandas, and how this course runs it Intermediate

    What pandas is for, its two structures (Series and DataFrame), how a DataFrame stores a table as labelled columns, and why the exercises here model pandas in plain Python.

  2. 2

    Series: one labelled column Intermediate

    Creating a Series, its values and index, selecting by label and by position, vectorised arithmetic, and alignment: why adding two Series lines values up by label and gives NaN where a label is missing.

  3. 3

    DataFrames: tables of labelled columns Intermediate

    Creating a DataFrame, its shape, columns, index and dtypes, looking at the first rows, selecting one or several columns, and summarising the numeric columns with describe.

Module practice

Module quiz

1. What does pandas add on top of NumPy arrays?
2. Adding two Series with different index labels…
3. What does df.shape return?
4. Which method gives count, mean, std and quartiles of numeric columns?
5. What does df.info() show that describe() does not?
6. Why can a column of integers become float64?

Selecting, cleaning and transforming ›