Reshaping by Pivoting and Grouping
Explore one of the most powerful options for data manipulations: pivot tables.
We'll cover the following...
We have multiple syntaxes to creat pivot tables in pandas. One of these uses the pivot_table
method, another common one leverages the groupby
method, and we can also represent some of these operations with the pd.crosstab
function.
Press + to interact
print(jb2)
A basic example
When our boss asks us to get numbers “by X column,” that should be a hint to pivot (or group) our data. Assume the boss ...