Skip to content

Instantly share code, notes, and snippets.

@sgsg704
Created August 24, 2021 06:43
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/70f73beb7cce6fb657f874a45b05e2f4 to your computer and use it in GitHub Desktop.
Save sgsg704/70f73beb7cce6fb657f874a45b05e2f4 to your computer and use it in GitHub Desktop.
# Get list of categorical variables
s = (data.dtypes == "object")
object_cols = list(s[s].index)
print("Categorical variables:")
print(object_cols)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment