attribute
The number of arguments.
Data attribute containing the number of arguments the ufunc takes, including optional ones.
Typically this value will be one more than what you might expect because all ufuncs take the optional “out” argument.
>>> import numpy as np >>> np.add.nargs 3 >>> np.multiply.nargs 3 >>> np.power.nargs 3 >>> np.exp.nargs 2
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.ufunc.nargs.html