BUG: Pandas 1.4; df.drop method raises an AttributeError when Int64 index is used and index is not unique #45860
Closed
2 of 3 tasks
Labels
Bug
ExtensionArray
Extending pandas with custom dtypes or arrays.
Index
Related to the Index class or subclasses
Regression
Functionality that used to work in a prior pandas version
Milestone
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
An exception
AttributeError: 'BooleanArray' object has no attribute 'nonzero'
is raised when the index is Int64 and not unique.https://github.com/pandas-dev/pandas/blob/main/pandas/core/generic.py#L4345 mask is a BooleanArray here instead of an ndarray when the Index is not unique and of dtype Int64.
It got introduced in 1.4 with this PR: #43760
Expected Behavior
No exception should be raised.
Installed Versions
The text was updated successfully, but these errors were encountered: