Created
March 16, 2018 03:04
-
-
Save okdolly-001/f1590b3fac3a4cb8306a7fded46dad38 to your computer and use it in GitHub Desktop.
Delete duplicate columns by value #pandas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Pandas deleting duplicate columns by value | |
df = pd.read_csv('data/test.csv') | |
df = df.loc[:, ~df.T.duplicated()] | |
df.to_csv('data/test.csv') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment