np.subtract()
时间: 2024-05-25 16:16:03 浏览: 49
OpenCV-Python图像的减法运算cv2.subtract函数详解以及和矩阵减法的差异对比.rar
5星 · 资源好评率100%
np.subtract() is a function in the NumPy library of Python that performs element-wise subtraction of two arrays or a scalar and an array. It returns a new array with the result of the subtraction. The syntax for np.subtract() is:
np.subtract(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj])
- x1: First input array
- x2: Second input array or scalar
- out: Optional output array
- where: Optional boolean array indicating where to perform the operation
- casting: Typecasting rules for the operation
- order: Order in which to process the array elements
- dtype: Data type for the output array
- subok: If True, the subclass of the output array is preserved.
阅读全文