Professional Documents
Culture Documents
df = pd.read_csv('train.csv')
df.head()
1. Categorical Data
a. Countplot
sns.countplot(df['Embarked'])
#df['Survived'].value_counts().plot(kind='bar')
<matplotlib.axes._subplots.AxesSubplot at 0x1cc48b021f0>
b. PieChart
df['Sex'].value_counts().plot(kind='pie',autopct='%.2f')
<matplotlib.axes._subplots.AxesSubplot at 0x1cc48b142e0>
2. Numerical Data
a. Histogram
import matplotlib.pyplot as plt
plt.hist(df['Age'],bins=5)
b. Distplot
sns.distplot(df['Age'])
<matplotlib.axes._subplots.AxesSubplot at 0x1cc4914c4f0>
c. Boxplot
sns.boxplot(df['Age'])
<matplotlib.axes._subplots.AxesSubplot at 0x1cc48ee1520>
df['Age'].min()
0.42
df['Age'].max()
80.0
df['Age'].mean()
29.69911764705882
df['Age'].skew()
0.38910778230082704