text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

data = pd.read_csv('../input/titanic/train_and_test2.csv')

data = data.rename(columns={'2urvived': 'Survived'})
data = data.drop(columns=['Passengerid', 'zero'])
for i in range(1, 19):
    data = data.drop(columns=f'zero.{i}')

data = data.dropna()

fig = plt.figure(figsize = (20, 20))

ax_1 = fig.add_subplot(3, 3, 1)
ax_2 = fig.add_subplot(3, 3, 2)
ax_3 = fig.add_subplot(3, 3, 3)
ax_4 = fig.add_subplot(3, 3, 4)
ax_5 = fig.add_subplot(3, 3, 5)
ax_6 = fig.add_subplot(3, 3, 6)
ax_7 = fig.add_subplot(3, 3, 7)
ax_8 = fig.add_subplot(3, 3, 8)
ax_9 = fig.add_subplot(3, 3, 9)

sns.lineplot(data = data, x = "Age", y = "Survived", ax = ax_1)
sns.lineplot(data = data, x = "Sex", y = "Survived", ax = ax_2)
sns.lineplot(data = data, x = "Fare", y = "Survived", ax = ax_3)
sns.lineplot(data = data, x = "Pclass", y = "Survived", ax = ax_4)
sns.lineplot(data = data, x = "sibsp", y = "Survived", ax = ax_5)
sns.lineplot(data = data, x = "Parch", y = "Survived", ax = ax_6)
sns.lineplot(data = data, x = "Embarked", y = "Survived", ax = ax_7)
sns.lineplot(data = data, x = "Age", y = "Fare", ax = ax_8)
sns.lineplot(data = data, x = "Sex", y = "Fare", ax = ax_9)

plt.show()

fig = plt.figure(figsize = (20, 20))

ax_1 = fig.add_subplot(3, 3, 1)
ax_2 = fig.add_subplot(3, 3, 2)
ax_3 = fig.add_subplot(3, 3, 3)
ax_4 = fig.add_subplot(3, 3, 4)
ax_5 = fig.add_subplot(3, 3, 5)
ax_6 = fig.add_subplot(3, 3, 6)
ax_7 = fig.add_subplot(3, 3, 7)
ax_8 = fig.add_subplot(3, 3, 8)
ax_9 = fig.add_subplot(3, 3, 9)

sns.barplot(data = data, x = "Age", y = "Survived", ax = ax_1)
sns.barplot(data = data, x = "Sex", y = "Survived", ax = ax_2)
sns.barplot(data = data, x = "Fare", y = "Survived", ax = ax_3)
sns.barplot(data = data, x = "Pclass", y = "Survived", ax = ax_4)
sns.barplot(data = data, x = "sibsp", y = "Survived", ax = ax_5)
sns.barplot(data = data, x = "Parch", y = "Survived", ax = ax_6)
sns.barplot(data = data, x = "Embarked", y = "Survived", ax = ax_7)
sns.barplot(data = data, x = "Age", y = "Fare", ax = ax_8)
sns.barplot(data = data, x = "Sex", y = "Fare", ax = ax_9)

plt.show()

sns.heatmap(data=data.corr(), linewidths=0.5, annot=True)
plt.show()