You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling np.finfo, I always get the << 'NoneType' object is not callable >> error, independently of the argument passed.
The error trace indicates that there's an error in the line
dtype = numeric.dtype(type(dtype))
and, if I do
from numpy.core import numeric
print(numeric.dtype)
I get a "None" value.
I guess it could be fixed by replacing the line above with something like:
dtype = dtype(type(dtype))
Reproduce the code example:
importnumpynp.finfo(np.float32)
Error message:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
File ~\anaconda3\envs\Melanion\lib\site-packages\numpy\core\getlimits.py:384, in finfo.__new__(cls, dtype)
383 try:
--> 384 dtype = numeric.dtype(dtype)
385 except TypeError:
386 # In case a float instance was given
TypeError: 'NoneType' object is not callable
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
Input In [62], in<cell line: 1>()
----> 1 np.finfo(
2 # np.float16,
3 np.float32,
4 # np.float64
5 ).dtype
File ~\anaconda3\envs\Melanion\lib\site-packages\numpy\core\getlimits.py:387, in finfo.__new__(cls, dtype)
384 dtype = numeric.dtype(dtype)
385 except TypeError:
386 # In case a float instance was given
--> 387 dtype = numeric.dtype(type(dtype))
389 obj = cls._finfo_cache.get(dtype, None)
390 if obj is not None:
TypeError: 'NoneType' object is not callable
NumPy/Python version information:
Python Version: 3.10.4
Numpy Version: 1.21.5
The text was updated successfully, but these errors were encountered:
See gh-21519, this is a cython issue and you must be in the situation of two things here:
Using debugging or tracing (i.e. an IDE such as Spyder may be doing that "for" you)
Using some other library which calls NumPy API from cython (that could be sklearn, pandas, or np.random in which case a NumPy upgrade will help)
The issue happens only with Python 3.10. It can be fixed, so long the library that causes the issue has a very recent upgrade available (using the new Cython). However, there is nothing more NumPy can do and it is tricky for us to know what is causing this.
It could very well be NumPy itself (i.e. np.random), in that case, please try upgrading NumPy.
Describe the issue:
When calling np.finfo, I always get the << 'NoneType' object is not callable >> error, independently of the argument passed.
The error trace indicates that there's an error in the line
dtype = numeric.dtype(type(dtype))
and, if I do
from numpy.core import numeric
print(numeric.dtype)
I get a "None" value.
I guess it could be fixed by replacing the line above with something like:
dtype = dtype(type(dtype))
Reproduce the code example:
Error message:
NumPy/Python version information:
Python Version: 3.10.4
Numpy Version: 1.21.5
The text was updated successfully, but these errors were encountered: