You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There currently is no elegant pattern to drop duplicate indices.
I think what people usually do is df[~df.index.duplicated(keep='first')]
Feature Description
Add a new parameter to drop_duplicates to specify dropping duplicate indices.
An option could be a index=True to do this, similar to when merging on an index.
Alternative Solutions
Allow the subset parameter of drop_duplicates to accept the name of the index.
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
There currently is no elegant pattern to drop duplicate indices.
I think what people usually do is
df[~df.index.duplicated(keep='first')]
Feature Description
Add a new parameter to
drop_duplicates
to specify dropping duplicate indices.An option could be a
index=True
to do this, similar to when merging on an index.Alternative Solutions
Allow the
subset
parameter ofdrop_duplicates
to accept the name of the index.Additional Context
No response
The text was updated successfully, but these errors were encountered: