Created
December 12, 2021 13:58
-
-
Save willywildan/d333ef256fdc9a54e8c840fdc40cd0b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 | |
def concat_df(train_data, test_data): | |
#Returns a concatenated df of training and test set | |
return pd.concat([train_data, test_data], sort=True).reset_index(drop=True) | |
#2 | |
df_train = pd.read_csv('https://storage.googleapis.com/dqlab-dataset/challenge/feature-engineering/titanic_train.csv') | |
df_test = pd.read_csv('https://storage.googleapis.com/dqlab-dataset/challenge/feature-engineering/titanic_test.csv') | |
df_all = concat_df(df_train, df_test) | |
#3 | |
df_train.name = 'Training Set' | |
df_test.name = 'Test Set' | |
df_all.name = 'All Set' | |
#4 | |
dfs = [df_train, df_test] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment