Last active
December 18, 2018 22:19
-
-
Save StrikingLoo/20268994c7c476cda214c7d050f073f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #returns only the rows where x is >5, by reference (writing on them alters original df) | |
| df2 = df.loc[df['x'] > 5] | |
| #returns only the rows where x is 0,1,2,3 or 4, by reference | |
| df3 = df.x.isin(range(4)) | |
| #returns only the rows where x is >5, by read-only reference (can't be written on) | |
| df4 = df[df['x']>5] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment