-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Closed
Description
The functions np.isposinf
and np.isneginf
fail for arrays with complex values.
>>> import numpy as np
>>> a = np.arange(2) + 1j
>>> np.isposinf(a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/numpy/lib/ufunclike.py", line 34, in func
return f(x, out=out, **kwargs)
File "/usr/lib/python3/dist-packages/numpy/lib/ufunclike.py", line 141, in isposinf
return nx.logical_and(nx.isinf(x), ~nx.signbit(x), out)
TypeError: ufunc 'signbit' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
>>> np.isneginf(a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/numpy/lib/ufunclike.py", line 34, in func
return f(x, out=out, **kwargs)
File "/usr/lib/python3/dist-packages/numpy/lib/ufunclike.py", line 202, in isneginf
return nx.logical_and(nx.isinf(x), nx.signbit(x), out)
TypeError: ufunc 'signbit' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
I used NumPy 1.14.5 and Python 3.6.