numpy max vs amax vs maximum

后端 未结 4 1547
被撕碎了的回忆
被撕碎了的回忆 2020-11-28 19:31

numpy has three different functions which seem like they can be used for the same things --- except that numpy.maximum can only be used element-wise, w

4条回答
  •  被撕碎了的回忆
    2020-11-28 19:59

    np.maximum not only compares elementwise but also compares array elementwise with single value

    >>>np.maximum([23, 14, 16, 20, 25], 18)
    array([23, 18, 18, 20, 25])
    

提交回复
热议问题