<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="In [2]: mi = pd.MultiIndex.from_product([[0, 1]]*2, names=[('first', 'level'), ('second', 'level')])

In [3]: mi.droplevel(('first', 'level'))
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~/nobackup/repo/pandas/pandas/core/indexes/multi.py in _get_level_number(self, level)
    775                                  'level number' % level)
--&gt; 776             level = self.names.index(level)
    777         except ValueError:

ValueError: 'first' is not in list

During handling of the above exception, another exception occurred:

KeyError                                  Traceback (most recent call last)
&lt;ipython-input-3-1952401ac0fc&gt; in &lt;module&gt;()
----&gt; 1 mi.droplevel(('first', 'level'))

~/nobackup/repo/pandas/pandas/core/indexes/base.py in droplevel(self, level)
   3177             level = [level]
   3178 
-&gt; 3179         levnums = sorted(self._get_level_number(lev) for lev in level)[::-1]
   3180 
   3181         if len(level) == 0:

~/nobackup/repo/pandas/pandas/core/indexes/base.py in &lt;genexpr&gt;(.0)
   3177             level = [level]
   3178 
-&gt; 3179         levnums = sorted(self._get_level_number(lev) for lev in level)[::-1]
   3180 
   3181         if len(level) == 0:

~/nobackup/repo/pandas/pandas/core/indexes/multi.py in _get_level_number(self, level)
    777         except ValueError:
    778             if not isinstance(level, int):
--&gt; 779                 raise KeyError('Level %s not found' % str(level))
    780             elif level &lt; 0:
    781                 level += self.nlevels

KeyError: 'Level first not found'

In [4]: mi.droplevel([('first', 'level')])
Out[4]: Int64Index([0, 1, 0, 1], dtype='int64', name=('second', 'level'))"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">2</span>]: <span class="pl-s1">mi</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">MultiIndex</span>.<span class="pl-en">from_product</span>([[<span class="pl-c1">0</span>, <span class="pl-c1">1</span>]]<span class="pl-c1">*</span><span class="pl-c1">2</span>, <span class="pl-s1">names</span><span class="pl-c1">=</span>[(<span class="pl-s">'first'</span>, <span class="pl-s">'level'</span>), (<span class="pl-s">'second'</span>, <span class="pl-s">'level'</span>)])

<span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-s1">mi</span>.<span class="pl-en">droplevel</span>((<span class="pl-s">'first'</span>, <span class="pl-s">'level'</span>))
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span>
<span class="pl-v">ValueError</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-c1">~</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">indexes</span><span class="pl-c1">/</span><span class="pl-s1">multi</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_get_level_number</span>(<span class="pl-s1">self</span>, <span class="pl-s1">level</span>)
    <span class="pl-c1">775</span>                                  <span class="pl-s">'level number'</span> <span class="pl-c1">%</span> <span class="pl-s1">level</span>)
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">776</span>             <span class="pl-s1">level</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-s1">names</span>.<span class="pl-en">index</span>(<span class="pl-s1">level</span>)
    <span class="pl-c1">777</span>         <span class="pl-s1">except</span> <span class="pl-v">ValueError</span>:

<span class="pl-v">ValueError</span>: <span class="pl-s">'first'</span> <span class="pl-c1">is</span> <span class="pl-c1">not</span> <span class="pl-s1">in</span> <span class="pl-s1">list</span>

<span class="pl-v">During</span> <span class="pl-s1">handling</span> <span class="pl-s1">of</span> <span class="pl-s1">the</span> <span class="pl-s1">above</span> <span class="pl-s1">exception</span>, <span class="pl-s1">another</span> <span class="pl-s1">exception</span> <span class="pl-s1">occurred</span>:

<span class="pl-v">KeyError</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-c1">&lt;</span><span class="pl-s1">ipython</span><span class="pl-c1">-</span><span class="pl-s1">input</span><span class="pl-c1">-</span><span class="pl-c1">3</span><span class="pl-c1">-</span><span class="pl-c1">1952401</span><span class="pl-s1">ac0fc</span><span class="pl-c1">&gt;</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-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">1</span> <span class="pl-s1">mi</span>.<span class="pl-en">droplevel</span>((<span class="pl-s">'first'</span>, <span class="pl-s">'level'</span>))

<span class="pl-c1">~</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">indexes</span><span class="pl-c1">/</span><span class="pl-s1">base</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">droplevel</span>(<span class="pl-s1">self</span>, <span class="pl-s1">level</span>)
   <span class="pl-c1">3177</span>             <span class="pl-s1">level</span> <span class="pl-c1">=</span> [<span class="pl-s1">level</span>]
   <span class="pl-c1">3178</span> 
<span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">3179</span>         <span class="pl-s1">levnums</span> <span class="pl-c1">=</span> <span class="pl-en">sorted</span>(<span class="pl-s1">self</span>.<span class="pl-en">_get_level_number</span>(<span class="pl-s1">lev</span>) <span class="pl-k">for</span> <span class="pl-s1">lev</span> <span class="pl-c1">in</span> <span class="pl-s1">level</span>)[::<span class="pl-c1">-</span><span class="pl-c1">1</span>]
   <span class="pl-c1">3180</span> 
   <span class="pl-c1">3181</span>         <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">level</span>) <span class="pl-c1">==</span> <span class="pl-c1">0</span>:

<span class="pl-c1">~</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">indexes</span><span class="pl-c1">/</span><span class="pl-s1">base</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">genexpr</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">.0</span>)
   <span class="pl-c1">3177</span>             <span class="pl-s1">level</span> <span class="pl-c1">=</span> [<span class="pl-s1">level</span>]
   <span class="pl-c1">3178</span> 
<span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">3179</span>         <span class="pl-s1">levnums</span> <span class="pl-c1">=</span> <span class="pl-s1">sorted</span>(<span class="pl-s1">self</span>.<span class="pl-en">_get_level_number</span>(<span class="pl-s1">lev</span>) <span class="pl-k">for</span> <span class="pl-s1">lev</span> <span class="pl-c1">in</span> <span class="pl-s1">level</span>)[::<span class="pl-c1">-</span><span class="pl-c1">1</span>]
   <span class="pl-c1">3180</span> 
   <span class="pl-c1">3181</span>         <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">level</span>) <span class="pl-c1">==</span> <span class="pl-c1">0</span>:

<span class="pl-c1">~</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">indexes</span><span class="pl-c1">/</span><span class="pl-s1">multi</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_get_level_number</span>(<span class="pl-s1">self</span>, <span class="pl-s1">level</span>)
    <span class="pl-c1">777</span>         <span class="pl-s1">except</span> <span class="pl-v">ValueError</span>:
    <span class="pl-c1">778</span>             <span class="pl-k">if</span> <span class="pl-c1">not</span> <span class="pl-en">isinstance</span>(<span class="pl-s1">level</span>, <span class="pl-s1">int</span>):
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">779</span>                 <span class="pl-s1">raise</span> <span class="pl-v">KeyError</span>(<span class="pl-s">'Level %s not found'</span> <span class="pl-c1">%</span> <span class="pl-en">str</span>(<span class="pl-s1">level</span>))
    <span class="pl-c1">780</span>             <span class="pl-s1">elif</span> <span class="pl-s1">level</span> <span class="pl-c1">&lt;</span> <span class="pl-c1">0</span>:
    <span class="pl-c1">781</span>                 <span class="pl-s1">level</span> <span class="pl-c1">+=</span> <span class="pl-s1">self</span>.<span class="pl-s1">nlevels</span>

<span class="pl-v">KeyError</span>: <span class="pl-s">'Level first not found'</span>

<span class="pl-v">In</span> [<span class="pl-c1">4</span>]: <span class="pl-s1">mi</span>.<span class="pl-en">droplevel</span>([(<span class="pl-s">'first'</span>, <span class="pl-s">'level'</span>)])
<span class="pl-v">Out</span>[<span class="pl-c1">4</span>]: <span class="pl-v">Int64Index</span>([<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'int64'</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span>(<span class="pl-s">'second'</span>, <span class="pl-s">'level'</span>))</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">Always the same story: if we allow users to pass tuples of stuff interchangeably with lists of stuff, then tuples as values (or names, as in this case) will cause problems.</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto"><code class="notranslate">Out[4]</code></p>
<p dir="auto">... as long as we all agree that the <code class="notranslate">level</code> argument can accept lists of names but not tuples of names. The only other option I see is to document that <code class="notranslate">droplevel</code> does not support tuple names (except as items of a list).</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.5.3.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 4.9.0-6-amd64<br>
machine: x86_64<br>
processor:<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: it_IT.UTF-8<br>
LOCALE: it_IT.UTF-8</p>
<p dir="auto">pandas: 0.24.0.dev0+14.g489cc24c8.dirty<br>
pytest: 3.5.0<br>
pip: 9.0.1<br>
setuptools: 39.0.1<br>
Cython: 0.25.2<br>
numpy: 1.14.1<br>
scipy: 0.19.0<br>
pyarrow: None<br>
xarray: None<br>
IPython: 6.2.1<br>
sphinx: 1.5.6<br>
patsy: 0.5.0<br>
dateutil: 2.7.0<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: 1.2.0dev<br>
tables: 3.3.0<br>
numexpr: 2.6.1<br>
feather: 0.3.1<br>
matplotlib: 2.0.0<br>
openpyxl: 2.3.0<br>
xlrd: 1.0.0<br>
xlwt: 1.3.0<br>
xlsxwriter: 0.9.6<br>
lxml: 4.1.1<br>
bs4: 4.5.3<br>
html5lib: 0.999999999<br>
sqlalchemy: 1.0.15<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.10<br>
s3fs: None<br>
fastparquet: None<br>
pandas_gbq: None<br>
pandas_datareader: 0.2.1</p>
</details>
<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="In [2]: mi = pd.MultiIndex.from_product([[0, 1]]*2, names=[('first', 'level'), ('second', 'level')])

In [3]: mi.droplevel(('first', 'level'))
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~/nobackup/repo/pandas/pandas/core/indexes/multi.py in _get_level_number(self, level)
    775                                  'level number' % level)
--&gt; 776             level = self.names.index(level)
    777         except ValueError:

ValueError: 'first' is not in list

During handling of the above exception, another exception occurred:

KeyError                                  Traceback (most recent call last)
&lt;ipython-input-3-1952401ac0fc&gt; in &lt;module&gt;()
----&gt; 1 mi.droplevel(('first', 'level'))

~/nobackup/repo/pandas/pandas/core/indexes/base.py in droplevel(self, level)
   3177             level = [level]
   3178 
-&gt; 3179         levnums = sorted(self._get_level_number(lev) for lev in level)[::-1]
   3180 
   3181         if len(level) == 0:

~/nobackup/repo/pandas/pandas/core/indexes/base.py in &lt;genexpr&gt;(.0)
   3177             level = [level]
   3178 
-&gt; 3179         levnums = sorted(self._get_level_number(lev) for lev in level)[::-1]
   3180 
   3181         if len(level) == 0:

~/nobackup/repo/pandas/pandas/core/indexes/multi.py in _get_level_number(self, level)
    777         except ValueError:
    778             if not isinstance(level, int):
--&gt; 779                 raise KeyError('Level %s not found' % str(level))
    780             elif level &lt; 0:
    781                 level += self.nlevels

KeyError: 'Level first not found'

In [4]: mi.droplevel([('first', 'level')])
Out[4]: Int64Index([0, 1, 0, 1], dtype='int64', name=('second', 'level'))"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">2</span>]: <span class="pl-s1">mi</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">MultiIndex</span>.<span class="pl-en">from_product</span>([[<span class="pl-c1">0</span>, <span class="pl-c1">1</span>]]<span class="pl-c1">*</span><span class="pl-c1">2</span>, <span class="pl-s1">names</span><span class="pl-c1">=</span>[(<span class="pl-s">'first'</span>, <span class="pl-s">'level'</span>), (<span class="pl-s">'second'</span>, <span class="pl-s">'level'</span>)])

<span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-s1">mi</span>.<span class="pl-en">droplevel</span>((<span class="pl-s">'first'</span>, <span class="pl-s">'level'</span>))
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span>
<span class="pl-v">ValueError</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-c1">~</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">indexes</span><span class="pl-c1">/</span><span class="pl-s1">multi</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_get_level_number</span>(<span class="pl-s1">self</span>, <span class="pl-s1">level</span>)
    <span class="pl-c1">775</span>                                  <span class="pl-s">'level number'</span> <span class="pl-c1">%</span> <span class="pl-s1">level</span>)
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">776</span>             <span class="pl-s1">level</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-s1">names</span>.<span class="pl-en">index</span>(<span class="pl-s1">level</span>)
    <span class="pl-c1">777</span>         <span class="pl-s1">except</span> <span class="pl-v">ValueError</span>:

<span class="pl-v">ValueError</span>: <span class="pl-s">'first'</span> <span class="pl-c1">is</span> <span class="pl-c1">not</span> <span class="pl-s1">in</span> <span class="pl-s1">list</span>

<span class="pl-v">During</span> <span class="pl-s1">handling</span> <span class="pl-s1">of</span> <span class="pl-s1">the</span> <span class="pl-s1">above</span> <span class="pl-s1">exception</span>, <span class="pl-s1">another</span> <span class="pl-s1">exception</span> <span class="pl-s1">occurred</span>:

<span class="pl-v">KeyError</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-c1">&lt;</span><span class="pl-s1">ipython</span><span class="pl-c1">-</span><span class="pl-s1">input</span><span class="pl-c1">-</span><span class="pl-c1">3</span><span class="pl-c1">-</span><span class="pl-c1">1952401</span><span class="pl-s1">ac0fc</span><span class="pl-c1">&gt;</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-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">1</span> <span class="pl-s1">mi</span>.<span class="pl-en">droplevel</span>((<span class="pl-s">'first'</span>, <span class="pl-s">'level'</span>))

<span class="pl-c1">~</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">indexes</span><span class="pl-c1">/</span><span class="pl-s1">base</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">droplevel</span>(<span class="pl-s1">self</span>, <span class="pl-s1">level</span>)
   <span class="pl-c1">3177</span>             <span class="pl-s1">level</span> <span class="pl-c1">=</span> [<span class="pl-s1">level</span>]
   <span class="pl-c1">3178</span> 
<span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">3179</span>         <span class="pl-s1">levnums</span> <span class="pl-c1">=</span> <span class="pl-en">sorted</span>(<span class="pl-s1">self</span>.<span class="pl-en">_get_level_number</span>(<span class="pl-s1">lev</span>) <span class="pl-k">for</span> <span class="pl-s1">lev</span> <span class="pl-c1">in</span> <span class="pl-s1">level</span>)[::<span class="pl-c1">-</span><span class="pl-c1">1</span>]
   <span class="pl-c1">3180</span> 
   <span class="pl-c1">3181</span>         <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">level</span>) <span class="pl-c1">==</span> <span class="pl-c1">0</span>:

<span class="pl-c1">~</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">indexes</span><span class="pl-c1">/</span><span class="pl-s1">base</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">genexpr</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">.0</span>)
   <span class="pl-c1">3177</span>             <span class="pl-s1">level</span> <span class="pl-c1">=</span> [<span class="pl-s1">level</span>]
   <span class="pl-c1">3178</span> 
<span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">3179</span>         <span class="pl-s1">levnums</span> <span class="pl-c1">=</span> <span class="pl-s1">sorted</span>(<span class="pl-s1">self</span>.<span class="pl-en">_get_level_number</span>(<span class="pl-s1">lev</span>) <span class="pl-k">for</span> <span class="pl-s1">lev</span> <span class="pl-c1">in</span> <span class="pl-s1">level</span>)[::<span class="pl-c1">-</span><span class="pl-c1">1</span>]
   <span class="pl-c1">3180</span> 
   <span class="pl-c1">3181</span>         <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">level</span>) <span class="pl-c1">==</span> <span class="pl-c1">0</span>:

<span class="pl-c1">~</span><span class="pl-c1">/</span><span class="pl-s1">nobackup</span><span class="pl-c1">/</span><span class="pl-s1">repo</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">indexes</span><span class="pl-c1">/</span><span class="pl-s1">multi</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">_get_level_number</span>(<span class="pl-s1">self</span>, <span class="pl-s1">level</span>)
    <span class="pl-c1">777</span>         <span class="pl-s1">except</span> <span class="pl-v">ValueError</span>:
    <span class="pl-c1">778</span>             <span class="pl-k">if</span> <span class="pl-c1">not</span> <span class="pl-en">isinstance</span>(<span class="pl-s1">level</span>, <span class="pl-s1">int</span>):
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">779</span>                 <span class="pl-s1">raise</span> <span class="pl-v">KeyError</span>(<span class="pl-s">'Level %s not found'</span> <span class="pl-c1">%</span> <span class="pl-en">str</span>(<span class="pl-s1">level</span>))
    <span class="pl-c1">780</span>             <span class="pl-s1">elif</span> <span class="pl-s1">level</span> <span class="pl-c1">&lt;</span> <span class="pl-c1">0</span>:
    <span class="pl-c1">781</span>                 <span class="pl-s1">level</span> <span class="pl-c1">+=</span> <span class="pl-s1">self</span>.<span class="pl-s1">nlevels</span>

<span class="pl-v">KeyError</span>: <span class="pl-s">'Level first not found'</span>

<span class="pl-v">In</span> [<span class="pl-c1">4</span>]: <span class="pl-s1">mi</span>.<span class="pl-en">droplevel</span>([(<span class="pl-s">'first'</span>, <span class="pl-s">'level'</span>)])
<span class="pl-v">Out</span>[<span class="pl-c1">4</span>]: <span class="pl-v">Int64Index</span>([<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'int64'</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span>(<span class="pl-s">'second'</span>, <span class="pl-s">'level'</span>))</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">Always the same story: if we allow users to pass tuples of stuff interchangeably with lists of stuff, then tuples as values (or names, as in this case) will cause problems.</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto"><code class="notranslate">Out[4]</code></p>
<p dir="auto">... as long as we all agree that the <code class="notranslate">level</code> argument can accept lists of names but not tuples of names. The only other option I see is to document that <code class="notranslate">droplevel</code> does not support tuple names (except as items of a list).</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.5.3.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 4.9.0-6-amd64<br>
machine: x86_64<br>
processor:<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: it_IT.UTF-8<br>
LOCALE: it_IT.UTF-8</p>
<p dir="auto">pandas: 0.24.0.dev0+14.g489cc24c8.dirty<br>
pytest: 3.5.0<br>
pip: 9.0.1<br>
setuptools: 39.0.1<br>
Cython: 0.25.2<br>
numpy: 1.14.1<br>
scipy: 0.19.0<br>
pyarrow: None<br>
xarray: None<br>
IPython: 6.2.1<br>
sphinx: 1.5.6<br>
patsy: 0.5.0<br>
dateutil: 2.7.0<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: 1.2.0dev<br>
tables: 3.3.0<br>
numexpr: 2.6.1<br>
feather: 0.3.1<br>
matplotlib: 2.0.0<br>
openpyxl: 2.3.0<br>
xlrd: 1.0.0<br>
xlwt: 1.3.0<br>
xlsxwriter: 0.9.6<br>
lxml: 4.1.1<br>
bs4: 4.5.3<br>
html5lib: 0.999999999<br>
sqlalchemy: 1.0.15<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.10<br>
s3fs: None<br>
fastparquet: None<br>
pandas_gbq: None<br>
pandas_datareader: 0.2.1</p>
</details>