Created
February 1, 2018 03:31
-
-
Save leleofg/9b57d59425393583c655e500519e3875 to your computer and use it in GitHub Desktop.
dataframe_2_example
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 | |
| 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