Skip to content

Instantly share code, notes, and snippets.

@himat
Created July 2, 2019 18:03
Show Gist options
  • Save himat/2e5acd9747bbcefa13de1db4d089d289 to your computer and use it in GitHub Desktop.
Save himat/2e5acd9747bbcefa13de1db4d089d289 to your computer and use it in GitHub Desktop.
[Filter a Pandas series] Use .where(.) chaining #pandas
test = {
383: 3.000000,
663: 1.000000,
726: 1.000000,
737: 9.000000,
833: 8.166667
}
pd.Series(test).where(lambda x : x!=1).dropna()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment