Created
June 30, 2015 09:42
-
-
Save seumasmorrison/3b11e41f8c0d4cb2b0d5 to your computer and use it in GitHub Desktop.
Deduping a DataFrame index
This file contains 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
def dedupe_df(df): | |
df['index'] = df.index | |
df = df.drop_duplicates(subset='index') | |
df = df.drop("index",1) | |
return df |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment