Country: Mexico
You are in the Mexico edition. Type your country to switch.
Nigeria
The Americas
Loading every country…
No country matches. Check the spelling, or choose "Any country" for the Global edition.
You are learning in the Mexico edition, with examples in pesos and from Mexico.
Your learning profile
Data skills: SQL and Python basics · Lesson 6 of 7
pandas basics and a first chart
pandas is a Python library that handles whole tables at once. This lesson reads the example sales file, looks at it, filters rows, groups and totals by city, draws a bar chart and saves it, and shows that every answer matches the SQL lessons.
This lesson is complete in writing. A video for it is on its way.
What you will learn
- By the end you can load a CSV file into pandas and take a first look at it.
- You can add a calculated column and filter rows with a condition.
- You can total values by group with groupby and join two tables with merge.
- You can draw a bar or line chart, save it, and check that every figure matches SQL.
Key terms in this lesson
- pandas
- A free, open-source Python library for working with tables of data, used to read files, filter rows, group and total values, join tables and draw simple charts.
- DataFrame
- A table of data in Python's pandas library, with named columns that can each hold a different type, such as dates, text or numbers.
- Code notebook
- A document that mixes runnable code cells with their results, tables, charts and notes, so an analysis can be run step by step and read by others.
- CSV file
- Comma-separated values: a plain-text file in which each line is a row and commas separate the columns. The most common format for exchanging tables of data.
- Data type
- What kind of value a column holds, such as a whole number, a decimal, text or a date. Numbers stored as text cannot be added or averaged.
- Boolean mask
- A column of true and false values, one per row, built from a condition and used to keep only the rows where the condition is true.
- Step 1: Loading a file and looking at it, not started
- Step 2: Columns and a calculated column, not started
- Step 3: Filtering rows, not started
- Step 4: Grouping and joining, not started
- Step 5: A first chart, saved as an image, not started
- Step 6: Two tools, one answer, not started
About 10 min of reading
Step 1 of 6
Loading a file and looking at it
Opening this step…
Step 2 of 6
Columns and a calculated column
This step opens when you finish the one above.
Step 3 of 6
Filtering rows
This step opens when you finish the one above.
Step 4 of 6
Grouping and joining
This step opens when you finish the one above.
Step 5 of 6
A first chart, saved as an image
This step opens when you finish the one above.
Step 6 of 6
Two tools, one answer
This step opens when you finish the one above.
Key takeaways
The key takeaways open when you finish every step.
Lesson quiz
6 questions. You need 85% to pass.
The quiz opens when you finish every step.
Stockertim Learn is education. It explains how investing works and never recommends buying or selling anything.
Popular in Mexico: Financial markets law and regulation: foundationsFutures contracts and CFDs