New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC: docs for issubdtype doesn't explain why complex64
is not a subdtype of complex
or complex_
#20259
Comments
Are you looking for |
If you pass a non-numpy type into Until #15773, this would give a |
Yes, that would do it, although it would be nice to have that kind of thing as a warning in the docs for dtypes under the part where it says "Built-in Python types" (https://numpy.org/doc/stable/reference/arrays.dtypes.html). |
I think this probably belongs as a warning in the docs for |
complex64
is not a subdtype of complex
or complex_
complex64
is not a subdtype of complex
or complex_
I also stumbled upon this, it is very irritating: np.issubdtype(np.dtype('complex64'), np.complex)
>>>DeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. To silence this warning, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
>>> False If I then follow the deprecation warning I still get: np.issubdtype(np.dtype('complex64'), complex)
>>> False Same for floats: np.issubdtype(np.dtype('float32'), float)
>>> False However: np.issubdtype(np.dtype('float64'), float)
>>> True But if I just want to know if I have a complex |
For completeness, I think: np.issubdtype(np.dtype('complex128'), complex)
>>> True |
Describe the issue:
Calling
issubdtype
on acomplex64
does not produce the correct output.Reproduce the code example:
Error message:
No response
NumPy/Python version information:
1.21 and current master (1046087)
The text was updated successfully, but these errors were encountered: