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

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

(train.shape, test.shape)

train_X = train.copy()
train_Y = train_X.pop('Transported')

def displayAllCateFeatInfo(df):
    pass

def splitCabinForNewFeatures(df):
    my_df = df.copy()
    split_cabin_df = my_df.Cabin.str.split('/', expand=True)
    my_df['CabinDeck'] = split_cabin_df[0]
    my_df['CabinSide'] = split_cabin_df[2]
    my_df.pop('Cabin')
    return my_df

def splitNameToGenerateFamilyName(df):
    my_df = df.copy()
    split_name_df = my_df.Name.str.split(' ', expand=True)
    my_df['FamilyName'] = split_name_df[1]
    my_df.pop('Name')
    return my_df
displayAllCateFeatInfo(splitNameToGenerateFamilyName(train_X))