Skip to content

[EA] ExtensionArray should support ndim==2 #21908

Closed
@jbrockmendel

Description

@jbrockmendel

There are a bunch of issues (indirectly) caused by the fact that we can't reshape a DatetimeIndex[tz] as 2D.

#13287, #17539, #19197, and each of the several issues about interpolation with datetime64[tz] dtypes. At the end of DataFrame._init_ndarray is:

        if dtype is None and is_object_dtype(values):
            values = maybe_infer_to_datetimelike(values)

        return create_block_manager_from_blocks([values], [columns, index])

but in the relevant cases, maybe_infer_to_datetimelike returns a tz-aware DatetimeIndex, which create_block_manager_from_blocks raises on because it is expecting values to be 2D.

I cleanest way to fix this seems to be supporting 2D shapes for DatetimeArray (and ideally others for compat)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions