March 2020
Beginner to intermediate
352 pages
8h 40m
English
We can customize the pandas dataframe with another technique called cross-tabulation. This allows us to cope with groupby and aggregation for better data analysis. pandas has the crosstab function, which helps when it comes to building a cross-tabulation table. The cross-tabulation table shows the frequency with which certain groups of data appear. Let's take a look:
pd.crosstab(df["make"], df["body-style"])
The output of the preceding code is as follows:

Let's apply margins and the margins_name attribute to display the ...
Read now
Unlock full access