import pandas as pd
cric = pd.read_html('http://stats.espncricinfo.com/ci/engine/player/348144.html?class=3;template=results;type=batting;view=innings', match='innings', na_values='-')
df = cric[0]
df.head(10)
# Clean up example,eg remove *
df['Start Date'] = pd.to_datetime(df['Start Date'])
df['Runs'] = df['Runs'].str.extract('(\d+)').astype(int)
df.dtypes
# Examle take out columns
col_choice = df.loc[:, 'Runs':'6s'].head(10)
#col_choice.to_csv('out.csv')
col_choice.head(10)
# If want to fill NaN with 0
df.fillna(0).head(10)
df.plot(kind='bar', x='Runs', y='BF')