Skip to content

Instantly share code, notes, and snippets.

@Alakhator
Created March 2, 2020 13:15
Show Gist options
  • Save Alakhator/245b7f297665bf0b1c6238eb57e58fc3 to your computer and use it in GitHub Desktop.
Save Alakhator/245b7f297665bf0b1c6238eb57e58fc3 to your computer and use it in GitHub Desktop.
%%timeit
data.groupby('C')["A"].mean()
mean =data.groupby('C')["A"].mean().rename("N").reset_index()
df_1 = data.merge(mean)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment