Skip to content Skip to sidebar Skip to footer

Calulating Number Of Series In Python Pandas

I wanted to calculate the number of series present in the given data. I need this information for the time-series count. Here I would like the user to select how to check series.

Solution 1:

IIUC, You want GroupBy.ngroups:

df.groupby(['Region','Country','Sales']).ngroups
#8 Output

Post a Comment for "Calulating Number Of Series In Python Pandas"