text_html_output_1.png
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

train_file_path = '../input/titanic/train.csv'
gs_file_path = '../input/titanic/gender_submission.csv'
main_df = pd.read_csv(train_file_path)
gender_sub_df = pd.read_csv(gs_file_path)

cols1 = main_df.columns.to_list()
cols2 = gender_sub_df.columns.to_list()

main_df.drop(main_df[main_df['Embarked'].isnull()].index, inplace=True, axis=0)

working_df = main_df
working_df.drop(['Name', 'Cabin', 'Ticket'], inplace=True, axis=1)

working_class_df = working_df[['Pclass', 'Survived']]
working_class_df

working_class_df_plot = working_class_df.groupby(['Pclass', 'Survived'])['Pclass'].count().to_frame()
working_class_df_plot.rename(columns={'Pclass': 'Count'}, inplace=True)
working_class_df_plot