numpy.argmin(Array,axis=None,out=None ) ) :返回特定轴上数组min元素的索引。
array:Input array to work on
axis :[int,可选] alongaspecifiedaxislike0or 1
out : [阵列可选] providesafeaturetoinsertoutputtotheout
arrayanditshouldbeofappropriateshapeanddtype
arrayofindicesintothearraywithsameshapeasarray.shape
withthedimensionalongaxisremoved。
# Python Program illustrating
# working of argmin ()
import numpy as geek
#工作在1d阵列上
array=geek.arange(8) )。
打印(输入阵列: (n ),阵列) )。
# returningindicesoftheminelement
# as per the indices
print ((nindicesofminelement : ),geek.argmin(Array,axis=0) ) ) ) ) ) ) )。
INPUT ARRAY:
索引of min element : 0
# Python Program illustarting
# working of argmin ()
import numpy as geek
#工作在2d阵列上
array=geek.random.randint(16,size=) 4,4 ) )
打印(输入阵列: (n ),阵列) )。
# returningindicesoftheminelement
# as per the indices
''''
0 2 4 0 - element
113 0索引
''''
print ((nindicesofminelement : ),geek.argmin(Array,axis=0) ) ) ) ) ) ) )。
INPUT ARRAY:
Indices of min element: [1 1 3 0]
# Python Program illustarting
# working of argmin ()
import numpy as geek
#工作在2d阵列上
array=geek.arange(10 ).reshape (2,5 ) )。
打印(阵列: (n ),阵列) )。
array[0][0]=10
阵列[1] [1]=1
阵列[0] [1]=1
打印((narray : (n ),array () ) ) ) )。
# Returns min element
print((NArray: )、geek.argmin ) (array ) ) ) ) ) ) ) 652
# firstoccurrenceofanminelementisgiven
print((nminelementindices: ),geek.argmin ) Array,axis=0) ) ) ) ) ) ) ) )。
array:
array:
array: 1
最小元素索引: [1000 ]