ABonny
0
Q:

python crosstab

# Using mt_cars dataset

pd.crosstab(index=[df['car'],df['mpg']], columns=df['color'], margins=True)
# index can set to multi-cascaded column, or just single column
# margins is to create sub-total for rows & columns
0

New to Communities?

Join the community