-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Open
Labels
API DesignEnhancementExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.
Description
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
Labels
API DesignEnhancementExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.