Skip to content

Instantly share code, notes, and snippets.

@AVJdataminer
Created April 14, 2019 14:30
Show Gist options
  • Save AVJdataminer/24e44f50292123cdd0faae82f27a5a68 to your computer and use it in GitHub Desktop.
Save AVJdataminer/24e44f50292123cdd0faae82f27a5a68 to your computer and use it in GitHub Desktop.
get dummies columns for object type columns only and concat to dataframe
dfo=df.select_dtypes(include=['object']) # select object type columns
df = pd.concat([df.drop(dfo, axis=1), pd.get_dummies(dfo)], axis=1)
@ibrahimsevki
Copy link

Is this also applicable to one column?

@AVJdataminer
Copy link
Author

AVJdataminer commented Jul 19, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment