In [1]:
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
In [2]:
df = pd.read_csv("./tendulkar_ODI.csv")
df.head()
Out[2]:
In [3]:
df["Runs"] = df["Runs"].str.replace("*", "").str.replace("T?DNB", "0").astype("int64")
In [4]:
df["4s"] = df["4s"].str.replace("-", "0").astype("int64")
In [5]:
plt.figure(figsize=(10,5))
sns.distplot(df["Runs"], bins=range(df["Runs"].min(), df["Runs"].max(), 10))
plt.xlabel("Runs Scored by Tendulkar")
plt.show()
In [6]:
plt.figure(figsize=(10,5))
sns.distplot(df["4s"], bins=range(df["4s"].min(), df["4s"].max()+1))
plt.xlabel("4s hit by Tendulkar")
plt.show()