Created
July 16, 2015 19:51
-
-
Save hunterowens/c9735359b17a4113c538 to your computer and use it in GitHub Desktop.
CA Pipeline Operators
This file contains 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
# coding: utf-8 | |
import pandas as pd | |
# Get the table by id, pick first item on the returned list | |
df = pd.read_html('http://primis.phmsa.dot.gov/comm/reports/operator/OperatorIM_opid_300.html?nocache=6511#_Incidents_tab_3', attrs={'id': '_4E112845Q'})[0] | |
# only in CA | |
df[df['State'] == 'CA'].keys() | |
# Sort by property damage | |
df[df['State'] == 'CA'].sort('PropertyDamage (A) ') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment