Pivot_table size function

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


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’?


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: