Created
August 27, 2018 19:18
-
-
Save arthuralvim/242aef56bfad5ac9592930b2468a62de 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
import pandas as pd | |
d = { | |
'col1': [True, True, False, False, True, False], | |
'col2': [False, True, False, True, True, False], | |
'col3': [True, False, False, False, True, False], | |
'col4': [True, False, True, False, True, True], | |
'col5': ['T', 'T', 'L', 'L', 'T', 'L'] | |
} | |
df = pd.DataFrame(data=d) | |
df[(df['col5'] == 'T') & (df['col1'])] | |
df[df['col5'] == 'T'] | |
df[df['col1']] | |
df[~df['col3']] | |
df[(df['col5'] == 'T') & ((df['col1']) | (df['col3']))] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment