<p dir="auto"><a href="https://www.dropbox.com/s/rgy9iqt9o8pvfdl/wontplot.pandas" rel="nofollow">https://www.dropbox.com/s/rgy9iqt9o8pvfdl/wontplot.pandas</a></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [3]: s = pd.load('wontplot.pandas')

In [5]: s.plot()
Traceback (most recent call last):

  File &quot;&lt;ipython-input-5-d3eb09d34df4&gt;&quot;, line 1, in &lt;module&gt;
    s.plot()

  File &quot;C:\dev\bin\Python27\lib\site-packages\pandas\tools\plotting.py&quot;, line 1727, in plot_series
    plot_obj.generate()

  File &quot;C:\dev\bin\Python27\lib\site-packages\pandas\tools\plotting.py&quot;, line 853, in generate
    self._make_plot()

  File &quot;C:\dev\bin\Python27\lib\site-packages\pandas\tools\plotting.py&quot;, line 1241, in _make_plot
    x = self._get_xticks(convert_period=True)

  File &quot;C:\dev\bin\Python27\lib\site-packages\pandas\tools\plotting.py&quot;, line 1031, in _get_xticks
    self.data = self.data.reindex(index=index.order())

  File &quot;C:\dev\bin\Python27\lib\site-packages\pandas\core\series.py&quot;, line 2638, in reindex
    return Series(new_values, index=new_index, name=self.name)

  File &quot;C:\dev\bin\Python27\lib\site-packages\pandas\core\series.py&quot;, line 489, in __new__
    subarr.index = index

  File &quot;properties.pyx&quot;, line 74, in pandas.lib.SeriesIndex.__set__ (pandas\lib.c:29092)

AssertionError: Index length did not match values


In [6]: s.index.shape
Out[6]: (480,)

In [7]: s.values.shape
Out[7]: (480,)"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">load</span>(<span class="pl-s">'wontplot.pandas'</span>)

<span class="pl-v">In</span> [<span class="pl-c1">5</span>]: <span class="pl-s1">s</span>.<span class="pl-en">plot</span>()
<span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>):

  <span class="pl-v">File</span> <span class="pl-s">"&lt;ipython-input-5-d3eb09d34df4&gt;"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1</span>, <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>
    <span class="pl-s1">s</span>.<span class="pl-en">plot</span>()

  <span class="pl-v">File</span> <span class="pl-s">"C:\dev<span class="pl-cce">\b</span>in\Python27\lib\site-packages\pandas<span class="pl-cce">\t</span>ools\plotting.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1727</span>, <span class="pl-s1">in</span> <span class="pl-s1">plot_series</span>
    <span class="pl-s1">plot_obj</span>.<span class="pl-en">generate</span>()

  <span class="pl-v">File</span> <span class="pl-s">"C:\dev<span class="pl-cce">\b</span>in\Python27\lib\site-packages\pandas<span class="pl-cce">\t</span>ools\plotting.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">853</span>, <span class="pl-s1">in</span> <span class="pl-s1">generate</span>
    <span class="pl-s1">self</span>.<span class="pl-en">_make_plot</span>()

  <span class="pl-v">File</span> <span class="pl-s">"C:\dev<span class="pl-cce">\b</span>in\Python27\lib\site-packages\pandas<span class="pl-cce">\t</span>ools\plotting.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1241</span>, <span class="pl-s1">in</span> <span class="pl-s1">_make_plot</span>
    <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">_get_xticks</span>(<span class="pl-s1">convert_period</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)

  <span class="pl-v">File</span> <span class="pl-s">"C:\dev<span class="pl-cce">\b</span>in\Python27\lib\site-packages\pandas<span class="pl-cce">\t</span>ools\plotting.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1031</span>, <span class="pl-s1">in</span> <span class="pl-s1">_get_xticks</span>
    <span class="pl-s1">self</span>.<span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-s1">data</span>.<span class="pl-en">reindex</span>(<span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">index</span>.<span class="pl-en">order</span>())

  <span class="pl-v">File</span> <span class="pl-s">"C:\dev<span class="pl-cce">\b</span>in\Python27\lib\site-packages\pandas\core\series.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">2638</span>, <span class="pl-s1">in</span> <span class="pl-s1">reindex</span>
    <span class="pl-k">return</span> <span class="pl-v">Series</span>(<span class="pl-s1">new_values</span>, <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">new_index</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">name</span>)

  <span class="pl-v">File</span> <span class="pl-s">"C:\dev<span class="pl-cce">\b</span>in\Python27\lib\site-packages\pandas\core\series.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">489</span>, <span class="pl-s1">in</span> <span class="pl-s1">__new__</span>
    <span class="pl-s1">subarr</span>.<span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-s1">index</span>

  <span class="pl-v">File</span> <span class="pl-s">"properties.pyx"</span>, <span class="pl-s1">line</span> <span class="pl-c1">74</span>, <span class="pl-s1">in</span> <span class="pl-s1">pandas</span>.<span class="pl-s1">lib</span>.<span class="pl-v">SeriesIndex</span>.<span class="pl-en">__set__</span> (<span class="pl-s1">pandas</span>\l<span class="pl-s1">ib</span>.<span class="pl-s1">c</span>:<span class="pl-c1">29092</span>)

<span class="pl-v">AssertionError</span>: <span class="pl-v">Index</span> <span class="pl-s1">length</span> <span class="pl-s1">did</span> <span class="pl-c1">not</span> <span class="pl-s1">match</span> <span class="pl-s1">values</span>


<span class="pl-v">In</span> [<span class="pl-c1">6</span>]: <span class="pl-s1">s</span>.<span class="pl-s1">index</span>.<span class="pl-s1">shape</span>
<span class="pl-v">Out</span>[<span class="pl-c1">6</span>]: (<span class="pl-c1">480</span>,)

<span class="pl-v">In</span> [<span class="pl-c1">7</span>]: <span class="pl-s1">s</span>.<span class="pl-s1">values</span>.<span class="pl-s1">shape</span>
<span class="pl-v">Out</span>[<span class="pl-c1">7</span>]: (<span class="pl-c1">480</span>,)</pre></div>
<p dir="auto">The following code prints False when run with Pandas 0.15.0, but True with 0.15.2; I'm using Python 2.7.6 on Ubuntu 14.04.1 in both cases. Is this change in behavior expected? (I was using has_duplicates to detect duplicate tuples in the index.)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import pandas as pd
t = [(u'x', u'out', u'z', 5, u'y', u'in', u'z', 169),
     (u'x', u'out', u'z', 7, u'y', u'in', u'z', 119),
     (u'x', u'out', u'z', 9, u'y', u'in', u'z', 135),
     (u'x', u'out', u'z', 13, u'y', u'in', u'z', 145),
     (u'x', u'out', u'z', 14, u'y', u'in', u'z', 158),
     (u'x', u'out', u'z', 16, u'y', u'in', u'z', 122),
     (u'x', u'out', u'z', 17, u'y', u'in', u'z', 160),
     (u'x', u'out', u'z', 18, u'y', u'in', u'z', 180),
     (u'x', u'out', u'z', 20, u'y', u'in', u'z', 143),
     (u'x', u'out', u'z', 21, u'y', u'in', u'z', 128),
     (u'x', u'out', u'z', 22, u'y', u'in', u'z', 129),
     (u'x', u'out', u'z', 25, u'y', u'in', u'z', 111),
     (u'x', u'out', u'z', 28, u'y', u'in', u'z', 114),
     (u'x', u'out', u'z', 29, u'y', u'in', u'z', 121),
     (u'x', u'out', u'z', 31, u'y', u'in', u'z', 126),
     (u'x', u'out', u'z', 32, u'y', u'in', u'z', 155),
     (u'x', u'out', u'z', 33, u'y', u'in', u'z', 123),
     (u'x', u'out', u'z', 12, u'y', u'in', u'z', 144)]
idx = pd.MultiIndex.from_tuples(t)
print idx.has_duplicates"><pre class="notranslate"><code class="notranslate">import pandas as pd
t = [(u'x', u'out', u'z', 5, u'y', u'in', u'z', 169),
     (u'x', u'out', u'z', 7, u'y', u'in', u'z', 119),
     (u'x', u'out', u'z', 9, u'y', u'in', u'z', 135),
     (u'x', u'out', u'z', 13, u'y', u'in', u'z', 145),
     (u'x', u'out', u'z', 14, u'y', u'in', u'z', 158),
     (u'x', u'out', u'z', 16, u'y', u'in', u'z', 122),
     (u'x', u'out', u'z', 17, u'y', u'in', u'z', 160),
     (u'x', u'out', u'z', 18, u'y', u'in', u'z', 180),
     (u'x', u'out', u'z', 20, u'y', u'in', u'z', 143),
     (u'x', u'out', u'z', 21, u'y', u'in', u'z', 128),
     (u'x', u'out', u'z', 22, u'y', u'in', u'z', 129),
     (u'x', u'out', u'z', 25, u'y', u'in', u'z', 111),
     (u'x', u'out', u'z', 28, u'y', u'in', u'z', 114),
     (u'x', u'out', u'z', 29, u'y', u'in', u'z', 121),
     (u'x', u'out', u'z', 31, u'y', u'in', u'z', 126),
     (u'x', u'out', u'z', 32, u'y', u'in', u'z', 155),
     (u'x', u'out', u'z', 33, u'y', u'in', u'z', 123),
     (u'x', u'out', u'z', 12, u'y', u'in', u'z', 144)]
idx = pd.MultiIndex.from_tuples(t)
print idx.has_duplicates
</code></pre></div>
<p dir="auto">Reference on StackOverflow <a href="http://stackoverflow.com/questions/27473093/understanding-the-pandas-multiindex-has-duplicates-property" rel="nofollow">here</a>.</p>