<p dir="auto"><a href="https://travis-ci.org/pandas-dev/pandas/jobs/348215410#L2717" rel="nofollow">https://travis-ci.org/pandas-dev/pandas/jobs/348215410#L2717</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[gw1] linux -- Python 3.6.4 /home/travis/miniconda3/envs/pandas/bin/python
self = &lt;pandas.tests.frame.test_analytics.TestDataFrameAnalytics object at 0x7f86fa5d54a8&gt;
axis = 0
    @pytest.mark.parametrize(&quot;axis&quot;, [0, 1, None])
    def test_clip_against_frame(self, axis):
        df = DataFrame(np.random.randn(1000, 2))
        lb = DataFrame(np.random.randn(1000, 2))
        ub = lb + 1
    
&gt;       clipped_df = df.clip(lb, ub, axis=axis)
pandas/tests/frame/test_analytics.py:2066: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pandas/core/generic.py:5605: in clip
    if np.any(pd.isnull(lower)):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = 0    False
1    False
dtype: bool
    def __nonzero__(self):
        raise ValueError(&quot;The truth value of a {0} is ambiguous. &quot;
                         &quot;Use a.empty, a.bool(), a.item(), a.any() or a.all().&quot;
&gt;                        .format(self.__class__.__name__))
E       ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()."><pre class="notranslate"><code class="notranslate">[gw1] linux -- Python 3.6.4 /home/travis/miniconda3/envs/pandas/bin/python
self = &lt;pandas.tests.frame.test_analytics.TestDataFrameAnalytics object at 0x7f86fa5d54a8&gt;
axis = 0
    @pytest.mark.parametrize("axis", [0, 1, None])
    def test_clip_against_frame(self, axis):
        df = DataFrame(np.random.randn(1000, 2))
        lb = DataFrame(np.random.randn(1000, 2))
        ub = lb + 1
    
&gt;       clipped_df = df.clip(lb, ub, axis=axis)
pandas/tests/frame/test_analytics.py:2066: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pandas/core/generic.py:5605: in clip
    if np.any(pd.isnull(lower)):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = 0    False
1    False
dtype: bool
    def __nonzero__(self):
        raise ValueError("The truth value of a {0} is ambiguous. "
                         "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
&gt;                        .format(self.__class__.__name__))
E       ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
</code></pre></div>
<p dir="auto">Reproducible example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [10]: df = pd.DataFrame({'col': range(9)}, index=pd.MultiIndex.from_product([['A0', 'A1', 'A2'], ['B0', 'B1', 'B2']], names=[1,2]))

In [11]: df
Out[11]: 
       col
1  2      
A0 B0    0
   B1    1
   B2    2
A1 B0    3
   B1    4
   B2    5
A2 B0    6
   B1    7
   B2    8

In [12]: pd.options.display.max_rows = 4

In [13]: df
Out[13]: 
       col
1  2      
A0 A0    0
   A0    1
...    ...
A2 A2    7
   A2    8

[9 rows x 1 columns]"><pre class="notranslate"><code class="notranslate">In [10]: df = pd.DataFrame({'col': range(9)}, index=pd.MultiIndex.from_product([['A0', 'A1', 'A2'], ['B0', 'B1', 'B2']], names=[1,2]))

In [11]: df
Out[11]: 
       col
1  2      
A0 B0    0
   B1    1
   B2    2
A1 B0    3
   B1    4
   B2    5
A2 B0    6
   B1    7
   B2    8

In [12]: pd.options.display.max_rows = 4

In [13]: df
Out[13]: 
       col
1  2      
A0 A0    0
   A0    1
...    ...
A2 A2    7
   A2    8

[9 rows x 1 columns]
</code></pre></div>
<p dir="auto">So the truncated repr shows incorrectly the first index level (with integer level name <code class="notranslate">1</code>) again for the second level.</p>
<hr>
<p dir="auto">Original post:</p>
<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
import wget
import pandas
import pickle

url = 'https://www.dropbox.com/s/aldllo0bi3m3wkl/stock?dl=1'
filename = wget.download(url)
df = pickle.load(open(filename))
df 
#bad display, index duplicated?
df.head() 
#expected display
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">wget</span>
<span class="pl-k">import</span> <span class="pl-s1">pandas</span>
<span class="pl-k">import</span> <span class="pl-s1">pickle</span>

<span class="pl-s1">url</span> <span class="pl-c1">=</span> <span class="pl-s">'https://www.dropbox.com/s/aldllo0bi3m3wkl/stock?dl=1'</span>
<span class="pl-s1">filename</span> <span class="pl-c1">=</span> <span class="pl-s1">wget</span>.<span class="pl-en">download</span>(<span class="pl-s1">url</span>)
<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pickle</span>.<span class="pl-en">load</span>(<span class="pl-en">open</span>(<span class="pl-s1">filename</span>))
<span class="pl-s1">df</span> 
<span class="pl-c">#bad display, index duplicated?</span>
<span class="pl-s1">df</span>.<span class="pl-en">head</span>() 
<span class="pl-c">#expected display</span></pre></div>
<h4 dir="auto">Problem description</h4>
<table border="1" role="table">   <thead>     <tr>       <th></th>       <th></th>       <th>merged</th>     </tr>     <tr>       <th>1</th>       <th>2</th>       <th></th>     </tr>   </thead>   <tbody>     <tr>       <th>a.</th>       <th>a.</th>       <td>2</td>     </tr>     <tr>       <th>abel</th>       <th>abel</th>       <td>1</td>     </tr>     <tr>       <th>agnes</th>       <th>agnes</th>       <td>2</td>     </tr>     <tr>       <th rowspan="2" valign="top">alain</th>       <th>alain</th>       <td>8</td>     </tr>     <tr>       <th>alain</th>       <td>2</td>     </tr>   </tbody> </table>
<p dir="auto">I have created a multi-index based on 2 columns .<br>
Those two columns wont appear properly, index_column "2" being duplicated from "1"<br>
When displaying up to the 60th first rows of dataframe, it's fine, then it duplicates again the column 1 in the column 2.</p>
<h4 dir="auto">Expected Output</h4>
<table border="1" role="table">  <thead>    <tr>      <th></th>      <th></th>      <th>merged</th>    </tr>    <tr>      <th>1</th>      <th>2</th>      <th></th>    </tr>  </thead>  <tbody>    <tr>      <th>a.</th>      <th>masson-dubois</th>      <td>2</td>    </tr>    <tr>      <th>abel</th>      <th>pinchard</th>      <td>1</td>    </tr>    <tr>      <th>agnes</th>      <th>paquet</th>      <td>2</td>    </tr>    <tr>      <th rowspan="2" valign="top">alain</th>      <th>corcia</th>      <td>8</td>    </tr>    <tr>      <th>hudelot-noellat</th>      <td>2</td>    </tr>  </tbody></table>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.9.final.0
python-bits: 64
OS: Linux
OS-release: 4.9.4-moby
machine: x86_64
processor: 
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
<p dir="auto">pandas: 0.19.1<br>
nose: None<br>
pip: 9.0.1<br>
setuptools: 28.8.0<br>
Cython: None<br>
numpy: 1.11.2<br>
scipy: 0.18.0<br>
statsmodels: 0.6.1<br>
xarray: None<br>
IPython: 5.1.0<br>
sphinx: None<br>
patsy: 0.4.1<br>
dateutil: 2.5.0<br>
pytz: 2016.7<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: None<br>
matplotlib: 1.5.3<br>
openpyxl: None<br>
xlrd: None<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: 4.5.1<br>
html5lib: None<br>
httplib2: 0.9.2<br>
apiclient: 1.5.1<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.8<br>
boto: None<br>
pandas_datareader: None</p>
</details>