This would fix help fix #9008.
From most to least-well defined
- Object arrays of
float,np.float32, np.datetime64... → return np.isnan(item)
- Object arrays of
int,np.int32, ... → return False
- Object arrays of any type that implements
__float__ or __int__ - return np.isnan(float(x))
- Object arrays of
np.ndarray → return np.isnan(item) (requires a O->O loop, not O->?)
- Any value →
return x != x
I think I'd draw the line after 3, and have 4 onwards throw an error.