<p dir="auto">I use dendrogram with the following <code class="notranslate">ndarray</code></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; Z.shape
(36951, 4)
&gt;&gt;&gt; dendrogram(Z)"><pre class="notranslate">&gt;&gt;&gt; Z.shape
(36951, 4)
&gt;&gt;&gt; dendrogram(Z)</pre></div>
<p dir="auto">It returns the following error:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;&lt;console&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/home/pyk/.virtualenvs/project-lisa/local/lib/python2.7/site-packages/scipy/cluster/hierarchy.py&quot;, line 2294, in dendrogram
    above_threshold_color=above_threshold_color)
  File &quot;/home/pyk/.virtualenvs/project-lisa/local/lib/python2.7/site-packages/scipy/cluster/hierarchy.py&quot;, line 2582, in _dendrogram_calculate_info
....
    leaf_label_func, i, labels)
  File &quot;/home/pyk/.virtualenvs/project-lisa/local/lib/python2.7/site-packages/scipy/cluster/hierarchy.py&quot;, line 2332, in _append_singleton_leaf_node
    ivl.append(str(int(i)))
RuntimeError: maximum recursion depth exceeded while getting the str of an object
"><pre class="notranslate">Traceback (most recent call last):
  File <span class="pl-s"><span class="pl-pds">"</span>&lt;console&gt;<span class="pl-pds">"</span></span>, line 1, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
  File <span class="pl-s"><span class="pl-pds">"</span>/home/pyk/.virtualenvs/project-lisa/local/lib/python2.7/site-packages/scipy/cluster/hierarchy.py<span class="pl-pds">"</span></span>, line 2294, <span class="pl-k">in</span> dendrogram
    above_threshold_color=above_threshold_color)
  File <span class="pl-s"><span class="pl-pds">"</span>/home/pyk/.virtualenvs/project-lisa/local/lib/python2.7/site-packages/scipy/cluster/hierarchy.py<span class="pl-pds">"</span></span>, line 2582, <span class="pl-k">in</span> _dendrogram_calculate_info
....
    leaf_label_func, i, labels)
  File <span class="pl-s"><span class="pl-pds">"</span>/home/pyk/.virtualenvs/project-lisa/local/lib/python2.7/site-packages/scipy/cluster/hierarchy.py<span class="pl-pds">"</span></span>, line 2332, <span class="pl-k">in</span> _append_singleton_leaf_node
    ivl.append(str(int(i)))
RuntimeError: maximum recursion depth exceeded <span class="pl-k">while</span> getting the str of an object
</pre></div>
<p dir="auto">Scipy version</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="% pip freeze
scipy==0.17.0"><pre class="notranslate">% pip freeze
scipy==0.17.0</pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/449558/24775834/72fa00fc-1aec-11e7-81cd-6c60eb9a294a.png"><img src="https://cloud.githubusercontent.com/assets/449558/24775834/72fa00fc-1aec-11e7-81cd-6c60eb9a294a.png" alt="image" style="max-width: 100%;"></a><br>
I'm trying to do a dendrogram:</p>
<blockquote>
<p dir="auto">ValueError: Linkage 'Z' uses the same cluster more than once.</p>
</blockquote>
<p dir="auto">Am I doing something wrong here?</p>