Skip to content

Make EAs for all Block subclasses #22388

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

Closed
jbrockmendel opened this issue Aug 16, 2018 · 0 comments
Closed

Make EAs for all Block subclasses #22388

jbrockmendel opened this issue Aug 16, 2018 · 0 comments
Labels
ExtensionArray Extending pandas with custom dtypes or arrays. Needs Discussion Requires discussion from core team before further action

Comments

@jbrockmendel
Copy link
Member

A Block is basically an Array with mgr_locs attached. An Index is basically an Array with some fancy indexing and set operations. These should share a bunch of their code.

Block.make_block behaves essentially the same way as Index._shallow_copy. blocks.make_block behaves like Index.__new__. Some values vs _values vs _ndarray_values vs _data juggling may be needed to combine these implementations.

For standard dtypes (float, int, uint, ...) these EAs can be thin wrappers around the numpy implementations.

Aside from de-duplicating a bunch of code, this would allow us to standardize on conventions like ".values always returns an EA".

The only change I envision to EA is that this would entail needing to support 2D arrays (which I'd prefer anyway...).

@jbrockmendel jbrockmendel added ExtensionArray Extending pandas with custom dtypes or arrays. Needs Discussion Requires discussion from core team before further action labels Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays. Needs Discussion Requires discussion from core team before further action
Projects
None yet
Development

No branches or pull requests

1 participant