Skip to content

Instantly share code, notes, and snippets.

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