Skip to content

API: ExtensionArray interface method to create an empty / all-NA array for a given dtype #39776

Open
@jorisvandenbossche

Description

@jorisvandenbossche

Specific use case comes from #39612 (comment), but in general it can sometimes be useful to be able to create an empty or all-NA array in an efficient way.

Since the ExtensionDtype/Array knows best how to do this efficiently, we can add a method to the extension array interface for this.

One question, though: I mentioned above "empty or all-NA", but this is not the same of course. An actually uninitialized array (np.empty(n, dtype)) can still be faster to create as an all-NA array (np.full(n, NA, dtype), or variant with the appropriate NA-sentinel).

But maybe we don't care much about this distinction, and just a version to create all-NA is fine? (or another constant fill_value)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions