Chapter 21
Data Manipulation
Learning Objectives
After completing all of the content in this chapter, you should be able to do the following:
- Aggregate data accross multiple columns (mean, median, mode)
- Append data: stack or concatenate multiple datasets with the
.concat
function - Recode and map values within a column to new values by providing conditional formatting
- Group data together with the
.groupby
function - Merge columns together based on the provided column or indices
- Restructure data long vs. wide with pandas melt and pivot functionality
Key Terminology
Aggregation
- GroupBy
Recoding Data
.replace()
.apply()
Reshaping Tables
.melt()
.concat()
.sort_values()
- wide format
- long format