O'Reilly logo
  • QIAN Weishuo thinks this is interesting:

the size aggregating function returns the total number of rows per group. This is different than the count aggregating function, which returns the number of non-missing values per group.

From

Cover of Pandas Cookbook

Note

size返回 总行数
count返回 非空行数