-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Closed
Description
Currently, it does not seem possible to pass on an array to catch the second output of a ufunc
via a keyword parameter:
a1 = np.array([1.])
a2 = np.array([1.])
np.modf(1.333, out=a1, out2=a2)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-4-9ca83f6d80bd> in <module>()
----> 1 np.modf(1.333, out=a1, out2=a2)
ValueError: cannot specify 'out' as both a positional and keyword argument
One can do np.modf(1.333, out=a1)
, which works as expected. If one gives instead np.modf(1.333, out2=a2)
, the first part is assigned to a2
. (Note that the documentation suggests to use out1, out2
, but any characters after out
simply seem to be skipped.)
It would seem good to have the option of giving these as keyword arguments. One solution might be to have it be consistent with the usage in __numpy_ufunc__
, i.e., one would give np.modf(values, out=(a1, a2))
.
Metadata
Metadata
Assignees
Labels
No labels