Skip to content

Instantly share code, notes, and snippets.

@rsalaza4
Created May 10, 2022 16:38
Show Gist options
  • Select an option

  • Save rsalaza4/e32eddf1fd160af7f676224a46b9e07a to your computer and use it in GitHub Desktop.

Select an option

Save rsalaza4/e32eddf1fd160af7f676224a46b9e07a to your computer and use it in GitHub Desktop.
# Add R (range) column
df_max = df.groupby('sample_group').max()
df_min = df.groupby('sample_group').min()
df_grouped['R'] = df_max['data'] - df_min['data']
df_grouped.head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment