title: python How to make a dendrogram from a dataframe
body: <p>I am trying to find dendrogram a dataframe created using PANDAS package in python. An example data is shown below. </p>
  
  <pre><code>import numpy as np
  from pandas import *
  import matplotlib.pyplot as plt
  from hcluster import pdist, linkage, dendrogram
  from numpy.random import rand
  
  Index= ['aaa','bbb','ccc','ddd','eee']
  Cols = ['A', 'B', 'C','D']
  df = DataFrame(abs(np.random.randn(5, 4)), index= Index, columns=Cols)
  
  
  &gt;&gt;&gt; df
              A         B         C         D
  aaa  0.987415  0.192240  0.709559  0.317106
  bbb  0.856932  0.252441  1.183127  0.712855
  ccc  1.687198  0.462673  1.046469  0.159287
  ddd  0.977152  2.657582  0.491975  0.027280
  eee  0.120464  0.945034  0.142658  0.537024
  &gt;&gt;&gt; 
  
  X = df.T.values #Transpose values 
  Y = pdist(X)
  Z = linkage(Y)
  dendrogram(Z)
  </code></pre>
  
  <p>The above code generate the dendrogram but misses the column names. How can I keep track of the same. </p>