Skip to content

Conversation

@mtsokol
Copy link
Contributor

@mtsokol mtsokol commented Aug 22, 2023

Hi!
This PR changes np.in1d calls to np.isin as np.in1d is being made private in numpy/numpy#24445.

I wasn't sure if arrays passed to it are surely 1d, therefore I called .ravel() to fully reproduce in1d behavior. If any of these lines actually operate on 1d arrays, then isin and in1d can be used interchangeably.

@mroeschke mroeschke added the Compat pandas objects compatability with Numpy or Python functions label Aug 22, 2023
@mroeschke mroeschke added this to the 2.1 milestone Aug 22, 2023
@mroeschke mroeschke merged commit 487c594 into pandas-dev:main Aug 22, 2023
@mroeschke
Copy link
Member

Thanks @mtsokol

meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Aug 22, 2023
mroeschke pushed a commit that referenced this pull request Aug 23, 2023
…calls) (#54697) Backport PR #54694: MAINT: Remove `np.in1d` function calls Co-authored-by: Mateusz Sokół <8431159+mtsokol@users.noreply.github.com>
@mtsokol mtsokol deleted the remove-np-in1d-calls branch August 23, 2023 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Compat pandas objects compatability with Numpy or Python functions

2 participants