Working with Data
Load a table, clean it, answer questions about it, and draw the chart. Three lessons and one project with pandas and matplotlib.
This track is for people who finished the main course and have data to work with: sales records, exam results, survey answers, measurements. In the main course you read CSV and JSON files with the standard library, where every question needs a loop. Here the same questions take one line of pandas.
Start with Reading Data Files → · Back to the main course
What you should already know
- Reading files with the standard library: Working with CSV and Working with JSON
- Lists of dictionaries: Nested Data
- Dates and Times
Lessons
| Lesson | You'll be able to |
|---|---|
| Reading Data Files | Load CSV and JSON into a DataFrame, select and filter rows, and handle missing values |
| pandas Basics | Sort, group, aggregate, pivot, and merge tables |
| Charts with matplotlib | Draw line, bar, histogram, and scatter charts, and save them as images |
| Project: Sales Data Report | Clean messy sales data and produce a report with tables and a three-panel chart |
What you need
You do not need to install anything to follow along. The editor on this site loads pandas and matplotlib when your code imports them, which makes the first run of an example slower than usual. To work with your own files, use the Python Lab, which has a file browser and an upload button.
On your own computer, install both packages first:
text
python -m pip install pandas matplotlib