Why is this the default behavior of numpy?
In [5]: np.dtype(None)
Out[5]: dtype('float64')
I was hoping to use np.issubdtype(None,float) for some type-checking involving return types for images (PIL likes 0-255 images, skimage likes [0,1) images), but that does not work. I'd be interested in a clean-looking workaround, but I'll be satisfied with an answer to the main question.
This is a special case where None is converted to the default dtype. See:
https://github.com/numpy/numpy/issues/2190
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With