Skip to content

Conversation

@saakshimore
Copy link

  • [] closes #xxxx(Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

Added ignore_index feature for df.isin() as part of #7258. Next step would be to add the check_entire_row param.

@saakshimore saakshimore force-pushed the feat/isin-ignore-index branch from dd28cec to 57284f0 Compare October 22, 2025 16:48
@saakshimore
Copy link
Author

pyodide unit test build fail isn't relevant to the changes I have proposed and seems to be a general issue affecting other PRs too

@saakshimore saakshimore force-pushed the feat/isin-ignore-index branch from 57284f0 to 9cce864 Compare October 28, 2025 19:37
@natmokval natmokval added Enhancement Reshaping Concat, Merge/Join, Stack/Unstack, Explode isin isin method labels Nov 2, 2025
@natmokval
Copy link
Contributor

@saakshimore, thanks for working on this. Could you please add a note in doc/source/whatsnew/v3.0.0.rst?

Regarding your tests:

  • we usually don't write docstrings for tests – I would suggest removing them (comments are okay).
  • in tests, we reference the number of the original issue. Could you please change GH#62620 to # GH#7258?
  • I would suggest to combine your tests into one and use parametrization

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raise ValueError("cannot compute isin with a duplicate axis.")
result = self.eq(values.reindex_like(self))
if ignore_index:
result = self.isin(values.to_dict("list"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converting a DataFrame to a Python dictionary is going to be a huge performance hit, and may introduce different comparison semantics than what pandas offers naturally. Is there a way to accomplish this using the built-in indexers, much like the not ignore_index case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement isin isin method Reshaping Concat, Merge/Join, Stack/Unstack, Explode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants