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

ExtensionArray isin #20617

Closed
TomAugspurger opened this issue Apr 5, 2018 · 4 comments
Closed

ExtensionArray isin #20617

TomAugspurger opened this issue Apr 5, 2018 · 4 comments
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Enhancement ExtensionArray Extending pandas with custom dtypes or arrays. isin isin method

Comments

@TomAugspurger
Copy link
Contributor

Some (many?) extension array scalar types will have a corresponding container type. For example, IPArray defines isin to match the standard library's behavior where an address can be in a network.

https://github.com/ContinuumIO/cyberpandas/blob/054d3a37fe84a8d222795c31bbf99ef34be90fbf/cyberpandas/ip_array.py#L349-L388

Do we want to dispatch isin to Extension arrays? #20522 is doing some work so that pd.core.algos(categorical) dispatches to a specialized (faster) .isin, so the additional work will be small.

@TomAugspurger TomAugspurger added Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff ExtensionArray Extending pandas with custom dtypes or arrays. labels Apr 5, 2018
@TomAugspurger
Copy link
Contributor Author

@Ma3aXaKa if you want to take a look at this, it should be pretty straightforward now that you did #20522.

@TomAugspurger TomAugspurger added this to the Next Major Release milestone Apr 25, 2018
@bourbaki
Copy link
Contributor

Sure. I will look at this.

@jbrockmendel jbrockmendel added the isin isin method label Oct 30, 2020
@jbrockmendel
Copy link
Member

I think of ser.isin(vals) as effectively Series([any(x == y for y in vals) for x in ser], index=ser.index). IIUC the IPArray example would have a pretty different semantic meaning, wouldn't it?

@jbrockmendel
Copy link
Member

There is now an ExtensionArray.isin; closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Enhancement ExtensionArray Extending pandas with custom dtypes or arrays. isin isin method
Projects
None yet
Development

No branches or pull requests

4 participants