Skip to main content
`Ctrl`+`K`

# skbio.stats.distance.SymmetricMatrix.condensed_form

SymmetricMatrix.condensed_form()

  Return an array of distances in condensed format.

  Returns:
    data ndarray

      One-dimensional numpy.ndarray of values in condensed format.

  See also

  `as_condensed`
  `redundant_form`
  `as_redundant`

  Notes

  Condensed format is described in [1].

  The conversion is not a constant-time operation, though it should be relatively quick to perform.

  References

  [1]

  http://docs.scipy.org/doc/scipy/reference/spatial.distance.html

  Examples

      >>> from skbio.stats.distance import SymmetricMatrix
      >>> sm = SymmetricMatrix([[0, 1, 2],
      ...                       [1, 0, 3],
      ...                       [2, 3, 0]], ids=['a', 'b', 'c'])
      >>> sm.condensed_form()
      array([ 1., 2., 3.])