size: Compute the Size of Each Group

size: Compute the Size of Each Group

If you want to get the count of elements in one column of a pandas DataFrame, use groupby and count

If you want to get the size of groups composed of 2 or more columns, use groupby and size instead. 

Google Colab notebook of this tip.

Previous tips on pandas.

Search

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran