title: Using Pearson correlation in sklearn FeatureAgglomeration
body: <p>I have a pandas dataframe with 100 rows and 10,000 features. I want to fit hierarchical clustering on my data by using pearson correlation as the affinity argument in <a href="http://scikit-learn.org/stable/modules/generated/sklearn.cluster.FeatureAgglomeration.html" rel="noreferrer">sklearn.cluster.FeatureAgglomeration</a>.</p>
  
  <p>I've tried two ways to make it work so far:
  The first is:</p>
  
  <pre><code>feature_agglomator = FeatureAgglomeration(n_clusters=10, affinity=np.corrcoef, linkage='average')
  </code></pre>
  
  <p>The second one:</p>
  
  <pre><code>from scipy.spatial.distance import correlation 
  feature_agglomator = FeatureAgglomeration(n_clusters=10,affinity='correlation', linkage='average')
  </code></pre>
  
  <p>After running:</p>
  
  <pre><code>feature_agglomator.fit_transform(X)
  </code></pre>
  
  <p>Both ended with the same exception:</p>
  
  <pre><code>ValueError: The condensed distance matrix must contain only finite values.
  </code></pre>
  
  <p>What can I do for it to work propery?</p>