-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Closed
Copy link
Labels
EnhancementExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.PerformanceMemory or execution speed performanceMemory or execution speed performance
Milestone
Description
In lots of places, pandas does something like if np.any(arr.isna())
, which is wasteful as we have to create an ndarray of booleans just to check whether there are any True
values.
Some arrays, like Arrow, know ahead of time whether there are any NAs in the array. Would it make sense to expose an API for an array saying whether they have any missing values?
With indexes, we work around this by caching a _hasnans
value. That wouldn't work for mutable arrays.
Metadata
Metadata
Assignees
Labels
EnhancementExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.PerformanceMemory or execution speed performanceMemory or execution speed performance