Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Last active September 21, 2021 14:13
Show Gist options
  • Save aniruddha27/3f4446ba23e3aa492fb5853d3cf37093 to your computer and use it in GitHub Desktop.
Save aniruddha27/3f4446ba23e3aa492fb5853d3cf37093 to your computer and use it in GitHub Desktop.
def filter_func(x):
return x['Item_Weight'].std() < 3
df_filter = df.groupby(['Item_Weight']).filter(filter_func)
df_filter.shape
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment