### Navigation

- index
- modules |
- modules |
- next |
- previous |
- SciPy v0.9 Reference Guide (DRAFT) »
- Clustering package (`scipy.cluster`) »
- Hierarchical clustering (`scipy.cluster.hierarchy`) »

# scipy.cluster.hierarchy.median

`scipy.cluster.hierarchy.``median`(y)

  Performs median/WPGMC linkage. See `linkage` for more information on the return structure and algorithm.

  The following are common calling conventions:

  1. `Z = median(y)`

     Performs median/WPGMC linkage on the condensed distance matrix `y`. See `linkage` for more information on the return structure and algorithm.

  2. `Z = median(X)`

     Performs median/WPGMC linkage on the observation matrix `X` using Euclidean distance as the distance metric. See linkage for more information on the return structure and algorithm.

  Parameters : | Q : ndarray A condensed or redundant distance matrix. A condensed distance matrix is a flat array containing the upper triangular of the distance matrix. This is the form that `pdist` returns. Alternatively, a collection of m observation vectors in n dimensions may be passed as a m by n array.
  Returns : | Z : ndarray The hierarchical clustering encoded as a linkage matrix.
  Seealso : | linkage: for advanced creation of hierarchical clusterings.

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- SciPy v0.9 Reference Guide (DRAFT) »
- Clustering package (`scipy.cluster`) »
- Hierarchical clustering (`scipy.cluster.hierarchy`) »