Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(5)  |  Derive(0)  |  Import(4)

src/p/y/PySurvey-0.1.2/pysurvey/util/InformationTheory/predImprove.py   PySurvey(Download)
'''
 
from Bio.Cluster import distancematrix
import numpy as np
 
 
        segment = x[seg_start:seg_end]
        dist =  distancematrix(np.array([base_segment,segment]),dist= dist_metric)[1]
        if y is not None:                   # if y series is also given, distance is average of x distance and y distance
           segment_y = y[i:i+m]
           dist_y =  distancematrix(np.array([base_segment_y,segment_y]),dist= dist_metric)[1]

src/h/y/hydrat-0.9.5/src/hydrat/common/distance_metrics.py   hydrat(Download)
    def basic(self, p, q):
      return bc.distancematrix((p,q), dist = self.dist)
 
    def vector_distances(self, v1, v2):
      if v1.dtype == numpy.uint64 or v2.dtype == numpy.uint64:
        raise TypeError, "Biopython cannot deal with uint64 arrays"
      results = numpy.empty((len(v1),len(v2)))
      for i,q in enumerate(v1):
        for j,r in enumerate(v2):
          results[i,j] = bc.distancematrix((q,r), dist=self.dist)[1][0]

src/j/c/jcvi-HEAD/algorithms/formula.py   jcvi(Download)
 
from math import log, exp
from Bio.Cluster import distancematrix
 
from jcvi.utils.cbook import human_size
    if not x or not y:
        return 0
    return 1 - distancematrix((x, y), dist="s")[1][0]
 
 

src/b/i/biopython-HEAD/Tests/test_Cluster.py   biopython(Download)
    def test_distancematrix_kmedoids(self):
        if TestCluster.module=='Bio.Cluster':
            from Bio.Cluster import distancematrix, kmedoids
        elif TestCluster.module=='Pycluster':
            from Pycluster import distancematrix, kmedoids

src/b/i/biopython-1.63/Tests/test_Cluster.py   biopython(Download)
    def test_distancematrix_kmedoids(self):
        if TestCluster.module=='Bio.Cluster':
            from Bio.Cluster import distancematrix, kmedoids
        elif TestCluster.module=='Pycluster':
            from Pycluster import distancematrix, kmedoids