Pivot_table size function

In the Business Metrics course, when working on the Net Promoter Score, we’re told to use

aggfunc='size'

for the pivot table function.

Is this using the numpy function called size? If so then why can we just call it ‘size’ and not ‘np.size’?

Thanks!

1 Like

This was how I used the function in the mission:

nps = df.pivot_table(index=‘yearmonth’,columns=[‘category’],aggfunc=‘size’)

It seems to work, but I don’t understand HOW it works. What is the function ‘size’ and what does it do?

I would also like to know the same thing, including it’s use here:

https://app.dataquest.io/m/468/business-metrics/4/net-promoter-score