fitVec = np.zeros((100, 2)) #Initializing the fitVec, where first column` will be the indices and second column will contain the values
After Initialization, fitVec gets assigned some values by running a function. Final fitVec values:
fitVec [[ 2.00000000e+01 2.42733444e+10]
[ 2.10000000e+01 2.53836270e+10]
[ 2.20000000e+01 2.65580909e+10]
[ 2.30000000e+01 2.76674886e+10]
[ 2.40000000e+01 2.88334239e+10]
[ 2.50000000e+01 3.00078878e+10]
[ 2.60000000e+01 3.11823517e+10]
[ 2.70000000e+01 3.22917494e+10]
[ 2.80000000e+01 3.34011471e+10]
[ 2.90000000e+01 3.45756109e+10]
[ 3.00000000e+01 3.57500745e+10]
[ 3.10000000e+01 3.68594722e+10]
[ 3.20000000e+01 3.79688699e+10]
[ 3.30000000e+01 3.90782676e+10]
[ 3.40000000e+01 4.02527315e+10]
[ 3.50000000e+01 4.14271953e+10]
[ 3.60000000e+01 4.25365930e+10]
[ 3.70000000e+01 4.36476395e+10]]
**I haven't shown all of the 100*4 matrix to make it look less messy. Now I want to select the twenty (20*4) minimum values out of it. I'm trying winner = np.argmin(fitVec[100,1]) but it gives me only one minimum value whereas I want 20 min values. How should I go about it?
argsortinstead ofargmin, and then take the first 20 elements.numpy.partitionandnumpy.argpartition.