Skip to content

Instantly share code, notes, and snippets.

@robintw
Created February 19, 2016 19:51
Show Gist options
  • Save robintw/82b15282508486cdbc81 to your computer and use it in GitHub Desktop.
Save robintw/82b15282508486cdbc81 to your computer and use it in GitHub Desktop.
import pandas as pd
df = pd.DataFrame({'Name': ['Soton Central', 'Soton Airport', 'London Paddington', 'Malvern Link', 'Great Malvern', 'Oxford'],
'TLC': ['SOU', 'SOA', 'PAD', 'MVL', 'GMV', 'OXF']})
selected_stations = ['London Paddington', 'Malvern Link']
df[df.Name.isin(selected_stations)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment