-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Open
Labels
Description
Both around and round supports complex input, but not trunc. This looks a bit abnormal.
Reproducing code example:
In [1]: import numpy as np
In [2]: a=np.array([complex(1+1j)]*3)
In [3]: np.around(a)
Out[3]: array([1.+1.j, 1.+1.j, 1.+1.j])
In [4]: np.round(a)
Out[4]: array([1.+1.j, 1.+1.j, 1.+1.j])
In [5]: np.trunc(a)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-17494546b8df> in <module>
----> 1 np.trunc(a)
TypeError: ufunc 'trunc' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''Numpy/Python version information:
1.19.1 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0]
Reactions are currently unavailable