Skip to content
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

algos.take calling validate_indices incorrectly? #26976

Closed
jbrockmendel opened this issue Jun 21, 2019 · 1 comment · Fixed by #27079
Closed

algos.take calling validate_indices incorrectly? #26976

jbrockmendel opened this issue Jun 21, 2019 · 1 comment · Fixed by #27079
Labels
Sparse Sparse Data Type
Milestone

Comments

@jbrockmendel
Copy link
Member

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.

@jreback
Copy link
Contributor

jreback commented Jun 27, 2019

yes this looks to be incorrect

jbrockmendel added a commit to jbrockmendel/pandas that referenced this issue Jun 27, 2019
@jreback jreback added the Sparse Sparse Data Type label Jun 27, 2019
@jreback jreback added this to the 0.25.0 milestone Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants