Skip to content

BUG: Index.get_indexer casts values is given as list #55834

Closed
@phofl

Description

@phofl

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

pd.options.future.infer_string = True

idx = pd.Index(["a", "b", None], dtype="object")
idx.get_indexer([None, "x"])


[-1 -1]

Issue Description

We cast the iterable to an Index, which will cast None to NaN and thus the fixtures won't match anymore. I think it makes sense here to keep object if idx is also object dtype?

cc @jbrockmendel @jorisvandenbossche

Expected Behavior

See above

Installed Versions

Replace this line with the output of pd.show_versions()

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignArrowpyarrow functionalityStringsString extension data type and string data

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions