python numpy中数组.min()

python numpy中数组.min()

[python] view plain copy
  1. import numpy as np  
  2. a = np.array([[1,5,3],[4,2,6]])  
  3. print(a.min()) #无参,所有中的最小值  
  4. print(a.min(0)) # axis=0; 每列的最小值  
  5. print(a.min(1)) # axis=1;每行的最小值  

结果:

1

[1 2 3]

[1 2]

猜你喜欢

转载自www.cnblogs.com/Rvin/p/9234679.html
今日推荐