Skip to content

algos.take calling validate_indices incorrectly? #26976

Closed
@jbrockmendel

Description

@jbrockmendel

https://github.com/pandas-dev/pandas/blob/master/pandas/core/algorithms.py#L1528

In core.algorithms.take:

    if allow_fill:
        # Pandas style, -1 means NA
        validate_indices(indices, len(arr))
        result = take_1d(arr, indices, axis=axis, allow_fill=True,
fill_value=fill_value)

It looks to me like the validate_indices call should be validate_indices(indices, arr.shape[axis]).

Found while attempting to simplify #26914.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SparseSparse Data Type

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions