How to use pandas to sort and add according to the values of two columns in one dataset and fill another dataset as required?

ab

what should I do with Python? thank you.

Oct.25,2021

PivotTable


df.groupby(["a", "b"]).b.count().unstack("b").fillna(0)
Menu