text_plain_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)

main_df_sex = main_df['Sex'].value_counts()
main_df_sex

main_df_sex = main_df[['Survived', 'Sex']]
main_df_sex_factor = pd.get_dummies(main_df_sex['Sex'])
main_df_sex_factor

main_df_sex['female'] = main_df_sex_factor['female']
main_df_sex['male'] = main_df_sex_factor['male']
main_df_sex.head()