Skip to content

Instantly share code, notes, and snippets.

@wibowotangara
Created January 20, 2024 14:16
Show Gist options
  • Save wibowotangara/c6a33985c7996efbfb98dea60a2e27fe to your computer and use it in GitHub Desktop.
Save wibowotangara/c6a33985c7996efbfb98dea60a2e27fe to your computer and use it in GitHub Desktop.
single_value_cols = [col for col in df.columns if df[col].nunique() == 1]
df = df.drop(columns=single_value_cols)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment