Did I find the right examples for you? yes no

# numpy.argmin

All Samples(487)  |  Call(438)  |  Derive(0)  |  Import(49)
```Return the indices of the minimum values along an axis.

--------
argmax : Similar function.  Please refer to `numpy.argmax` for detailed
documentation.
```

```        def argmin(a, axis=None):
"""
Return the indices of the minimum values along an axis.

--------
argmax : Similar function.  Please refer to `numpy.argmax` for detailed
documentation.

"""
try:
argmin = a.argmin
except AttributeError:
return _wrapit(a, 'argmin', axis)
return argmin(axis)
```

```print results
print 'best result for k, by AIC, BIC, R2_adj, L1O'
print np.r_[(np.argmin(results[:,1:3],0), np.argmax(results[:,3],0),
np.argmin(results[:,-1],0))]

```

```print results
print 'best result for k, by AIC, BIC, R2_adj, L1O'
print np.r_[(np.argmin(results[:,1:3],0), np.argmax(results[:,3],0),
np.argmin(results[:,-1],0))]

```

```    def nearest(self, pt):
d = self.data
distances = [get_segment_point_dist(
d[i], pt)[0] for i in xrange(self.n)]
return numpy.argmin(distances)
```
```        #print "distances",distances
#print "argmin", numpy.argmin(distances)
return possibles[numpy.argmin(distances)]

```
```        #print "distances",distances
#print "argmin", numpy.argmin(distances)
return possibles[numpy.argmin(distances)]

```

```    dy = y - embedding[1]
dy[index] = 1
this_dx = dx[np.argmin(np.abs(dy))]
this_dy = dy[np.argmin(np.abs(dx))]
if this_dx > 0:
```

```    elif len(check)>=2:
#print check,check[np.argmin(track2track[check][:,2])]
good_correspondence.append(check[np.argmin(track2track[check][:,2])])
#good_correspondence.append())

```

```    def find_xmin(self):
from numpy import unique, asarray, argmin
#Much of the rest of this function was inspired by Adam Ginsburg's plfit code,
#specifically the mapping and sigma threshold behavior:
```
```
if good_values.all():
min_D_index = argmin(self.Ds)
self.noise_flag = False
elif not good_values.any():
min_D_index = argmin(self.Ds)
```
```def find_xmin(data, discrete=False, xmax=None, search_method='Likelihood', return_all=False, estimate_discrete=True, xmin_range=None):
from numpy import sort, unique, asarray, argmin, vstack, arange, sqrt
if 0 in data:
print("Value 0 in data. Throwing out 0 values")
data = data[data != 0]
```
```    good_values = sigmas < .1
#Find the last good value (The first False, where sigma > .1):
xmin_max = argmin(good_values)
if good_values.all():  # If there are no fits beyond the noise threshold
min_D_index = argmin(Ds)
```

```    for i in xrange(vector.size-size):
sub = vector[i:i+size]
j = np.argmin(sub)
if sub[j] < m-s and j != 0 and j != size-1 and sub[j] < sub[j-1] and sub[j] < sub[j+1] and sub[j] != 0:
```

```def argmin(x, axis=-1):
return np.argmin(x, axis)

def newobj(self, type):
if type is None:
```

```	print "FINAL FEV on validation set", numpy.mean(1-numpy.divide(validation_error,variance))

return (min_val_err,numpy.argmin(b.T,axis=0),min_val_err_array/len(validation_inputs))

def returnPredictedActivities(self,inputs):
```
```                 #tmp.append(numpy.sum(numpy.abs(                                    numpy.multiply(activities[i].T  - modelActivities[j],numpy.mat(self.reliable_indecies).T))                                    ))
#tmp.append(numpy.corrcoef(modelActivities[j].T, activities[i])[0][1])
x = numpy.argmin(array(tmp))

#x = numpy.argmax(array(tmp))
```
```                 tmp.append(numpy.sum(numpy.power(numpy.multiply(numpy.multiply(activities[i].T-modelActivities[j],numpy.mat(self.reliable_indecies)),numpy.mat(significant_neurons).T),2))/ numpy.sum(significant_neurons))

x = numpy.argmin(array(tmp))
if x == i: correct+=1.0

```
```        for j in xrange(0,len(responses)):
tmp.append(numpy.sqrt(numpy.mean(numpy.power(numpy.mat(responses)[i]-model_responses[j],2))))
x = numpy.argmin(tmp)
z = tmp[i]
ranks.append(numpy.nonzero((numpy.sort(tmp)==z)*1.0)[0][0])
```

```        xyz_srcs = self.xyz_source(flat_srcs)
d = volgeom.distance(xyz_srcs, xyz_trg)
i = np.argmin(d)
# d is a 2D array, get the row number with the lowest d
source = flat_srcs[i / xyz_trg.shape[0]]
```
```        src_xyz = self.xyz_source(source)
d = volgeom.distance(trg_xyz, src_xyz)
i = np.argmin(d)

return trgs[i / src_xyz.shape[0]]
```

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next