一直按照字面意思理解,以为maxmum取最大值
examples,原来是有广播机制的.
np.maximum()取对应位置上的大值,np.minimum 取对应位置上的较小值.
import numpy as np
>>> np.maximum([1,2,3,4,5],2)
array([2, 2, 3, 4, 5])
>>> np.minimum([2, 3, 4], [1, 5, 2])
array([1, 3, 2])
>>> np.maximum(np.eye(3),0.5)
array([[1. , 0.5, 0.5],
[0.5, 1. , 0.5],
[0.5, 0.5, 1. ]])