Skip to content

Make EAs for all Block subclasses #22388

Closed
@jbrockmendel

Description

@jbrockmendel

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...).

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExtensionArrayExtending pandas with custom dtypes or arrays.Needs DiscussionRequires discussion from core team before further action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions