In [8]:
import pandas as pd
import numpy as np
import matplotlib as plt
df = pd.read_csv("~/Downloads/train.csv")
df.describe()
Out[8]:
In [13]:
df['Age'].median()
Out[13]:
In [14]:
df['Sex'].unique()
Out[14]:
In [17]:
fig = plt.pyplot.figure()
ax = fig.add_subplot(111)
ax.hist(df['Age'], bins=10, range = (df['Age'].min(), df['Age'].max()))
plt.pyplot.title('Age Distribution')
plt.pyplot.xlabel('Age')
plt.pyplot.ylabel('Passenger Count')
plt.pyplot.show()
In [ ]:
source = "http://www.analyticsvidhya.com/blog/2014/08/baby-steps-python-performing-exploratory-analysis-python/"