Summary
In this chapter we have looked at ways to manipulate data frames, from cleaning and filtering, to grouping, aggregation, and reshaping. Pandas makes a lot of the common operations very easy and more complex operations, such as pivoting or grouping by multiple attributes, can often be expressed as one-liners as well. Cleaning and preparing data is an essential part of data exploration and analysis.
The next chapter explains a brief of machine learning algorithms that is applying data analysis result to make decisions or build helpful products.
Practice exercises
Exercise 1: Cleaning: In the section about filtering, we used the Europe Brent Crude Oil Spot Price, which can be found as an Excel document on the internet. Take this Excel spreadsheet and try to convert it into a CSV document that is ready to be imported with Pandas.
Hint: There are many ways to do this. We used a small tool called xls2csv.py
and we were able to load the resulting CSV file with a helper method:
import datetime...