-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Index.union with both bools and ints, duplicates #44000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The problem in here is the >>> import pandas as pd
>>> pd.value_counts([0, True, 1])
True 2
0 1
dtype: int64
>>> pd.value_counts([0, 1, True])
1 2
0 1
dtype: int64 Edit: |
There are several other places where mixed ints and bools are considered interchangeably:
So unless we want to distinguish True and 1 in all those cases, I am not sure the example in the top post is actually "wrong". |
Fair enough. The OP was an attempt at boiling down a more definitely-wrong behavior:
|
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 master branch of pandas.
Reproducible Example
Issue Description
Best guess is union_with_duplicates cc @phofl
Breaks at least one test in #43930
Expected Behavior
Index([1, True, 0, False], dtype=object)
The text was updated successfully, but these errors were encountered: