Skip to content

BUG: Index.union with both bools and ints, duplicates #44000

Open
@jbrockmendel

Description

@jbrockmendel

  • 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

idx = pd.Index([1, True, 0, False])
idx2 = idx[1:]

>>> idx.union(idx2)
Index([0, 0, 1, 1], dtype='object')

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexRelated to the Index class or subclassessetopsunion, intersection, difference, symmetric_difference

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions