Skip to content

Instantly share code, notes, and snippets.

Created Feb 4, 2021
What would you like to do?
train_df = pd.concat([X,y],axis=1)
survived = train_df[train_df['Survived']==1]
deceased = train_df[train_df['Survived']==0]
deceased = deceased.sample(n=len(survived), random_state=101)
train_df = pd.concat([survived,deceased],axis=0)
X_train = train_df.drop('Survived',axis=1)
y_train = train_df['Survived']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment