python numpy中数组.min()

机器学习实战笔记(Python实现)-01-K近邻算法(KNN) -小白入坑笔记

https://blog.csdn.net/ssdut_209/article/details/50938413

 

>>> a=array([[1,5,3],[2,6,3]])
>>> a
array([[1, 5, 3],
       [2, 6, 3]])
>>> print(a.min())  #无参,所有中的最小值 
1
>>> print(a.min(0))  ## axis=0; 每列的最小值
[1 5 3]
>>> print(a.min(1))  ##axis=1;每行的最小值
[1 2]
>>> 

 

posted @ 2018-04-28 21:40  月夜_1  阅读(4190)  评论(0编辑  收藏  举报