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
The functions isnan, isposinf and isneginf do not accept a fraction as an argument. Note that, however, math.nan accepts a fraction (but the math module has the drawback of not having the equivalent of isposinf and isneginf).
TypeError Traceback (most recent call last)
<ipython-input-1-bead9135402d> in <module>
1 import numpy as np
2 from fractions import Fraction
----> 3 np.isnan(Fraction(1, 2))
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Related discussion in #12988 and #16377, particularly this comment which gets at the larger issue of why no object loops are defined for these functions.
The functions isnan, isposinf and isneginf do not accept a fraction as an argument. Note that, however, math.nan accepts a fraction (but the math module has the drawback of not having the equivalent of isposinf and isneginf).
Reproducing code example:
Error message:
Numpy/Python version information:
1.16.4 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
The text was updated successfully, but these errors were encountered: