Skip to content

Instantly share code, notes, and snippets.

@sgsg704
Created November 26, 2021 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgsg704/5cc0c9c998cd704029d09316b7742215 to your computer and use it in GitHub Desktop.
Save sgsg704/5cc0c9c998cd704029d09316b7742215 to your computer and use it in GitHub Desktop.
for col in trainX.columns:
if trainX[col].dtype=='object':
trainX.drop([col],axis=1,inplace=True)
for col in test.columns:
if test[col].dtype=='object':
test.drop([col],axis=1,inplace=True)
trainY = pd.DataFrame()
trainY['AdoptionSpeed'] = trainX['AdoptionSpeed']
trainX=trainX.drop(['AdoptionSpeed','State', 'VideoAmt' ,'PhotoAmt'],axis=1)
test=test.drop(['State','VideoAmt' ,'PhotoAmt'],axis=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment