title: Use Distance Matrix in scipy.cluster.hierarchy.linkage()?
body: <p>I have a distance matrix n*n <code>M</code> where <code>M_ij</code> is the distance between <code>object_i</code> and <code>object_j</code>. So as expected, it takes the following form:</p>
  
  <pre><code>   /  0     M_01    M_02    ...    M_0n\
     | M_10    0      M_12    ...    M_1n |
     | M_20   M_21     0      ...    M2_n |
     |                ...                 |
     \ M_n0   M_n2    M_n2    ...      0 / 
  </code></pre>
  
  <p>Now I wish to cluster these n objects with hierarchical clustering. Python has an implementation of this called <code>scipy.cluster.hierarchy.linkage(y, method='single', metric='euclidean')</code>.</p>
  
  <p><a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.linkage.html" rel="noreferrer">Its documentation</a> says:</p>
  
  <blockquote>
    <p>y must be a {n \choose 2} sized vector where n is the number of
    original observations paired in the distance matrix.</p>
    
    <p>y : ndarray </p>
    
    <p>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
    an m by n array.</p>
  </blockquote>
  
  <p>I am confused by this description of <code>y</code>. <strong>Can I directly feed my <code>M</code> in as the input <code>y</code>?</strong></p>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>@hongbo-zhu-cn <a href="https://github.com/scipy/scipy/issues/2614" rel="noreferrer">has raised this issue up in GitHub</a>. This is exactly what I am concerning about. However, as a newbie to GitHub, I don't know how it works and therefore have no idea how this issue is dealt with.</p>