Skip to content

Instantly share code, notes, and snippets.

@naenumtou
Created July 27, 2020 06:46
Show Gist options
  • Save naenumtou/cf81346ec4c6e63b1f15900eadb6bf32 to your computer and use it in GitHub Desktop.
Save naenumtou/cf81346ec4c6e63b1f15900eadb6bf32 to your computer and use it in GitHub Desktop.
nor = df.groupby('country').transform(lambda x: (x - x.min()) / (x.max() - x.min()))
nor = nor['keep1','keep2','keep3']
nor = nor.add_prefix('nor_')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment