text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sn

train = pd.read_csv('../input/titanic/train.csv')
test = pd.read_csv('../input/titanic/test.csv')

sn.barplot(x='Sex', y='Survived', data=train)
print('Percentage of females who survived:', train['Survived'][train['Sex'] == 'female'].value_counts(normalize=True)[1] * 100)
print('Percentage of males who survived:', train['Survived'][train['Sex'] == 'male'].value_counts(normalize=True)[1] * 100)