This chapter added to our arsenal of pandas tricks to aggregate, join, and transform data. Here is a quick recap of the chapter:
- groupby creates groups of rows – one group for each category in a categorical variable (or a combination of categories across categorical variables).
- Using groupby, the same analysis can be performed on different groups efficiently.
- Similarly shaped DataFrames can be concatenated or appended to perform analysis simultaneously for the entire dataset.
- SQL-like joining or merging between DataFrames is also possible.
- Wide data can be made longer, or vice versa, depending on the requirement.
- pandas can handle multi-index data and there are functions to convert multi-index data to single-index data and vice versa.
- Spreadsheet operations such as pivot tables and transposes are possible and provide more flexibility than in spreadsheets.
In the...