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.
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 anyTruevalues.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
_hasnansvalue. That wouldn't work for mutable arrays.