### Navigation

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

# scipy.cluster.hierarchy.from_mlab_linkage

`scipy.cluster.hierarchy.``from_mlab_linkage`(Z)

  Converts a linkage matrix generated by MATLAB(TM) to a new linkage matrix compatible with this module.

  The conversion does two things:

  > - the indices are converted from `1..N` to `0..(N-1)` form, and
  > - a fourth column Z[:,3] is added where Z[i,3] is represents the number of original observations (leaves) in the non-singleton cluster i.

  This function is useful when loading in linkages from legacy data files generated by MATLAB.

  Parameters : | Z : ndarray A linkage matrix generated by MATLAB(TM).
  Returns : | ZS : ndarray A linkage matrix compatible with this library.

### Navigation

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