Skip to content

Instantly share code, notes, and snippets.

@ayoskovich
Created September 5, 2020 15:13
Show Gist options
  • Save ayoskovich/b95665161c7dffc120833751308e2687 to your computer and use it in GitHub Desktop.
Save ayoskovich/b95665161c7dffc120833751308e2687 to your computer and use it in GitHub Desktop.
Return df rows where any of multiple columns are above a certain number.
df[df.apply(lambda x: np.any(x > 100_000), axis=1, raw=True)]
@ayoskovich
Copy link
Author

I don't think raw=True is 100% necessary but it's probably faster...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment