Did I find the right examples for you? yes no

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

See Also
--------
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.

    See Also
    --------
    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)
        


src/s/c/scikits.statsmodels-0.3.1/scikits/statsmodels/sandbox/examples/example_pca_regression.py   scikits.statsmodels(Download)
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))]
 

src/s/t/statsmodels-0.4.3/statsmodels/sandbox/examples/example_pca_regression.py   statsmodels(Download)
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))]
 

src/p/y/PySAL-1.5.0/pysal/cg/segmentLocator.py   PySAL(Download)
    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)]
 
 

src/s/c/scikit-learn-0.13.1/examples/applications/plot_stock_market.py   scikit-learn(Download)
    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:

src/d/i/dipy-0.5.0/doc/examples/find_correspondence.py   dipy(Download)
    elif len(check)>=2:
        #print check,check[np.argmin(track2track[check][:,2])]
        good_correspondence.append(check[np.argmin(track2track[check][:,2])])
        #good_correspondence.append())
 

src/p/o/powerlaw-.8/powerlaw.py   powerlaw(Download)
    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:
#http://code.google.com/p/agpy/source/browse/trunk/plfit/plfit.py?spec=svn359&r=357
 
        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)

src/r/e/remix-2.1.2/examples/earworm/earworm.py   remix(Download)
    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:
            res.add((i+j, sub[j]))

src/n/u/numpy3k-HEAD/numpy/numarray/functions.py   numpy3k(Download)
def argmin(x, axis=-1):
    return np.argmin(x, axis)
 
def newobj(self, type):
    if type is None:

src/t/o/topographica-HEAD/releases/0.9.7/topographica/contrib/modelfit.py   topographica(Download)
	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])

src/p/y/PyMVPA-HEAD/mvpa2/misc/surfing/volume_mask_dict.py   PyMVPA(Download)
        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