You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
See also the discussion in #40602: the current interface does not yet provide a way to get an all-NA array, which is half of this issue (if we decide that's useful enough of course).
I think on the other PR, I mentioned the option of adding a keyword to empty() to ask for all-NAs (and if not asking for it, it can still be all NA (as we do for some implementations), but doesn't need to be guaranteed)
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)
The text was updated successfully, but these errors were encountered: