LingPy

lingpy.lexstat.LexStat.pairwise_distances

LexStat.pairwise_distances()

Calculate the lexicostatistical distance between all taxa.

Returns :

dist_matrix : numpy.array

A two-dimensional array containing the scores for the pairwise distances between all taxa.

Examples

Load the benchmark file SLV.lxs which contains manually conducted cognate judgments.

>>> from lingpy import *
>>> lex = LexStat(get_file('SLV.lxs'))
>>> dist = lex.pairwise_distances()
>>> formstring = '{0[0]:.2f} {0[1]:.2f} {0[2]:.2f} {0[3]:.2f}'
>>> for line in dist: print(formstring.format(line))
0.00 0.15 0.18 0.17
0.15 0.00 0.20 0.10
0.18 0.20 0.00 0.20
0.17 0.10 0.20 0.00