Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Last active September 21, 2021 14:13
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
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