# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import warnings
warnings.filterwarnings('ignore')
import pandas as pd
import numpy as np
import re
from plotnine import *

train = pd.read_csv('data/train.csv')
test = pd.read_csv('data/test.csv')

train.head()

train.describe()

train.isnull().sum()

train['Survived'].value_counts()

train.groupby('Sex')[['Survived']].mean()

train.pivot_table('Survived',['Sex', 'Pclass', 'Embarked'])

test['Cabin2'] = test['Cabin'].str.extract(r'(^\w)')

test

test.head()

submission = test[['PassengerId', 'Survived']]



submission.head()

# %mkdir submissions

submission.to_csv('submissions/submission.csv', index=False)

# %pwd

StarcoderdataJupyterScriptsDedupFiltered