pandas Filters

Some things that pandas makes easy:

Action pandas code
View a Column df['name] or
View 2 Columns df[['name', 'name2']]
View First 2 Rows df[:2]
View All Rows Where Value > 50 df[df['value'] > 50]
View a Row df.ex['RowID']
View a Column df.ix[:, 'value']
View a “Cell” based on row and column df.ix['rowid', 'column']

e.g., males = df[(df[Gender] == 'male') & (df[Year] == 2014)]

Leave a Reply