7 Advanced grouping, joining, and sorting

In the previous chapter, we used three of the central tools in pandas: grouping data across different columns, joining multiple data frames, and sorting a data frame by its index or one or more columns. As we saw, each of these techniques gives us a powerful way to manipulate our data into a form that allows for better understanding and interpretation.

In this chapter, we’ll explore deeper ways to use these techniques, both by themselves and together. We’ll turn multiple CSV files into a single data frame, we’ll group and sort by multiple columns, and we’ll use the filter method to keep and reject rows based on group properties. After going through the exercises in this chapter, you’ll have an even stronger ...

Get Pandas Workout now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.