def distances(self, word, words):
    """Calculate eucledean pairwise distances between `word` and `words`.

    Args:
      word (string): single word.
      words (list): list of strings.

    Returns:
      numpy array of the distances.

    Note:
      L2 metric is used to calculate distances.
    """

    point = self[word]
    vectors = np.asarray([self[w] for w in words])
    diff = vectors - point
    distances = np.linalg.norm(diff, axis=1)
    return distances
def distances ( self , word , words ) : point = self [ word ] vectors = np . asarray ( [ self [ w ] for w in words ] ) diff = vectors - point distances = np . linalg . norm ( diff , axis = 1 ) return distances
Calculate eucledean pairwise distances between `word` and `words`.

    Args:
      word (string): single word.
      words (list): list of strings.

    Returns:
      numpy array of the distances.

    Note:
      L2 metric is used to calculate distances.