- All Courses
- Python Foundations for Data Work
- Analysing Data with pandas
- DataFrames and Series
Lesson 4.1
DataFrames and Series
A DataFrame is a table of Series, each with its own dtype.
31mBeginner16.9k students
Overview
Look at the data before you trust it
A DataFrame is a table of Series, each with its own dtype. The first thing to do after loading is inspect the dtypes and the null counts, because a numeric column read as text will silently produce nonsense averages later.
Label-based and position-based selection are separate accessors on purpose. Mixing them is the source of most confusing indexing errors, especially after a filter has left a non-contiguous index.
Parse dates at load time rather than converting afterwards. It is one argument and it saves an entire category of comparison bugs.
In this lesson you will:
- Load a dataset and inspect its shape
- Select rows and columns predictably
- Fix dtypes before analysing
Resources
Notes are not saved yet — they clear when you leave this page.
Previous Lesson
Dates, paths, and the standard library
35m
Filtering, grouping, and aggregation
27m