numpy.ufunc.nargs# 属性 ufunc.nargs# 参数数量。 一个数据属性,包含 ufunc 接受的参数数量,包括可选参数。 备注 通常,这个值会比您预期的多一,因为所有 ufunc 都会接受可选的“out”参数。 示例 在浏览器中试试! >>> import numpy as np >>> np.add.nargs 3 >>> np.multiply.nargs 3 >>> np.power.nargs 3 >>> np.exp.nargs 2 返回在新标签页中打开