Why Pandas Transform fails if you only have a single column,df.groupby('a').transform('count')