Python for data
Read files, work with tables of data, and answer questions with code.
Real data is in files. In this course you read text, CSV, and JSON files with Python. You filter, sort, group, and join rows. You clean data that has mistakes, and you write results to a file. Every lesson uses the data of one made-up bike share service. You use only the tools that come with Python. Do the Python course first, or know the same things.
- Intermediate
- 15 lessons
- 4 h 18 min
- Free
Not started
Lessons
- 1Read a text fileOpen a file, read its lines, and clean each line.14 min
- 2Rows from a CSV fileRead a table with the csv module, and change text to numbers.15 min
- 3Rows as dictionariesRead each row as a dictionary, convert the numbers, and write a function that loads a file.15 min
- 4Filter and pickKeep the rows that you need, pick one column, and calculate with the result.16 min
- 5Sort and rankPut rows in order by a column, take the top of the list, and decide what happens with equal values.15 min
- 6Count and groupCount the rows of each group, add up a column for each group, and calculate an average for each group.18 min
- 7Numbers that describe dataDescribe a column with a mean and a median, and find the values that are far from the others.15 min
- 8Clean messy dataFix spaces and capital letters, handle values that are not numbers, and remove rows that repeat.18 min
- 9Dates and timesChange text to a moment in time, find the weekday and the hour, and calculate the time between two moments.16 min
- 10Join two tablesCombine the rows of two files with a lookup dictionary, and handle the rows that have no match.16 min
- 11JSON dataRead data that has values inside values, write JSON text, and read a file with one JSON value on each line.16 min
- 12Words in textCut text into clean words, count them, find a word, and cut a long text into parts.16 min
- 13Write filesSave results as a CSV file and as a text report with columns that line up.18 min
- 14Quiz, Python for dataQuizFourteen questions on files, rows, groups, clean data, dates, joins, and JSON.10 min
- 15Project: the report of a weekProjectClean a raw file of trips, join it with the stations, and write a report as JSON.40 min