def parse_distmat(lines):
 header = None
 result = []
 for line in lines:
  if (line[0] == ' DCTB '):
   header = map(strip, line.split(' DCTB ')[1:])
  else:
   result.append(map(float, line.split(' DCTB ')[1:]))
 return (header, asarray(result))

def parse_distmat ( lines ) : header = None result = [ ] for line in lines : if ( line [ 0 ] == ' DCTB ' ) : header = map ( strip , line . split ( ' DCTB ' ) [ 1 : ] ) else : result . append ( map ( float , line . split ( ' DCTB ' ) [ 1 : ] ) ) return ( header , asarray ( result ) )
parser for distance matrix file .