Skip to content

Instantly share code, notes, and snippets.

@leleofg
Created February 1, 2018 03:31
Show Gist options
  • Select an option

  • Save leleofg/9b57d59425393583c655e500519e3875 to your computer and use it in GitHub Desktop.

Select an option

Save leleofg/9b57d59425393583c655e500519e3875 to your computer and use it in GitHub Desktop.
dataframe_2_example
import pandas as pd
purchase_1 = pd.Series({'Name': 'Chris',
'Item Purchased': 'Dog Food',
'Cost': 22.50})
purchase_2 = pd.Series({'Name': 'Kevyn',
'Item Purchased': 'Kitty Litter',
'Cost': 2.50})
purchase_3 = pd.Series({'Name': 'Vinod',
'Item Purchased': 'Bird Seed',
'Cost': 5.00})
df = pd.DataFrame([purchase_1, purchase_2, purchase_3], index=['Store 1', 'Store 1', 'Store 2'])
df['Name'][df['Cost']>3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment