Apply vs transform on a group object,df.groupby('A')['C'].transform(zscore)