Created
March 2, 2020 13:10
-
-
Save Alakhator/a3def65ea87dc3b6f3c69e05e99876ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mean_purchase =df.groupby('User_ID')["Purchase"].mean().rename("User_mean").reset_index() | |
df_1 = df.merge(mean_purchase) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment