ENH: Add first_inverted and last_inverted options to keep in DataFrame.duplicated #60394
Open
1 of 3 tasks
Labels
duplicated
duplicated, drop_duplicates
Enhancement
Needs Discussion
Requires discussion from core team before further action
Needs Info
Clarification about behavior needed to assess issue
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
I suggest adding options
first_inverted
andlast_inverted
askeep
options to functionpandas.DataFrame.duplicated
. Below an example of how it would work and what it would return.df = pd.DataFrame({
'brand': ['Yum Yum', 'Yum Yum', 'Yum Yum', 'Indomie', 'Indomie', 'Indomie'],
'style': ['cup', 'cup', 'cup', 'cup', 'pack', 'pack'],
'rating': [4, 4, 4, 3.5, 15, 5],
})
df.duplicated(keep='first_inverted')
0 True
1 False
2 False
3 False
4 False
5 False
dtype: bool
Feature Description
.
Alternative Solutions
.
Additional Context
No response
The text was updated successfully, but these errors were encountered: