Skip to content

Instantly share code, notes, and snippets.

@this-is-richard
Created April 25, 2019 09:57
Show Gist options
  • Select an option

  • Save this-is-richard/c19f9bdfbba66f0fb8984e0601217a46 to your computer and use it in GitHub Desktop.

Select an option

Save this-is-richard/c19f9bdfbba66f0fb8984e0601217a46 to your computer and use it in GitHub Desktop.
for col in categorical:
df[col] = df[col].map(lambda x: str(x))
df = pd.get_dummies(df, drop_first=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment