If you want to get the count of elements in one column of a pandas DataFrame, use groupby and count.
groupby
count
If you want to get the size of groups composed of 2 or more columns, use groupby and size instead.
size
Google Colab notebook of this tip.
Previous tips on pandas.