Array in python numpy.min() Machine Learning Practical Notes (Python Implementation)-01-K Nearest Neighbor Algorithm (KNN) - Xiaobai's Notes

Machine Learning Practical Notes (Python Implementation)-01-K Nearest Neighbor Algorithm (KNN) - Xiaobai's Notes

>>> a=array([[1,5,3],[2,6,3]])
>>> a
array([[1, 5, 3],
       [ 2, 6, 3 ]])
 >>> print (a.min()) #No parameters, the minimum value of all is
 1
>>> print (a.min(0)) # # axis=0; min value per column 
[ 1 5 3 ]
 >>> print (a.min(1 )) ##axis=1; min value per row value 
[ 1 2 ]
 >>>

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325040346&siteId=291194637