<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<blockquote>
<blockquote>
<blockquote>
<p dir="auto">df = pd.DataFrame({"a" : [0,1,2], "b" : [1,2,3]})<br>
df[["a", "a"]].apply(lambda x: x[0] + x[1], axis = 1)</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">0    0<br>
1    2<br>
2    4<br>
dtype: int64</p>
<h4 dir="auto">output of <code class="notranslate">pd.show_versions()</code></h4>
<p dir="auto">Traceback (most recent call last):<br>
File "C:\Users\Alexander\Anaconda3\lib\site-packages\pandas\indexes\base.py", line 1980, in get_value<br>
tz=getattr(series.dtype, 'tz', None))<br>
File "pandas\index.pyx", line 103, in pandas.index.IndexEngine.get_value (pandas\index.c:3332)<br>
File "pandas\index.pyx", line 111, in pandas.index.IndexEngine.get_value (pandas\index.c:3035)<br>
File "pandas\index.pyx", line 154, in pandas.index.IndexEngine.get_loc (pandas\index.c:3955)<br>
File "pandas\index.pyx", line 169, in pandas.index.IndexEngine._get_loc_duplicates (pandas\index.c:4236)<br>
TypeError: unorderable types: str() &gt; int()</p>
</blockquote>
</blockquote>
</blockquote>
<p dir="auto">During handling of the above exception, another exception occurred:</p>
<p dir="auto">Traceback (most recent call last):<br>
File "", line 1, in <br>
File "C:\Users\Alexander\Anaconda3\lib\site-packages\pandas\core\frame.py", line 4061, in apply<br>
return self._apply_standard(f, axis, reduce=reduce)<br>
File "C:\Users\Alexander\Anaconda3\lib\site-packages\pandas\core\frame.py", line 4157, in _apply_standard<br>
results[i] = func(v)<br>
File "", line 1, in <br>
File "C:\Users\Alexander\Anaconda3\lib\site-packages\pandas\core\series.py", line 583, in <strong>getitem</strong><br>
result = self.index.get_value(self, key)<br>
File "C:\Users\Alexander\Anaconda3\lib\site-packages\pandas\indexes\base.py", line 2000, in get_value<br>
raise IndexError(key)<br>
IndexError: (0, 'occurred at index 0')</p>
<p dir="auto">This is the error I get when running on Python 3.5.1/Pandas 0.18.1 on Windows. I get the expected output on Linux running Python 2.7.11/Pandas 0.18.1.</p>
<p dir="auto">The last line of the following code snippet does not work, while it seems it should. Am I overlooking something?</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="df = pd.DataFrame(np.random.randn(9,2), index=[1,1,1,2,2,2,3,3,3], columns=['a', 'b'])
df
df.loc[[1, 2]]    # works
df.loc[:,['a', 'b']]    # works
df.loc[[1, 2], ['a', 'b']]    # does not work"><pre class="notranslate"><code class="notranslate">df = pd.DataFrame(np.random.randn(9,2), index=[1,1,1,2,2,2,3,3,3], columns=['a', 'b'])
df
df.loc[[1, 2]]    # works
df.loc[:,['a', 'b']]    # works
df.loc[[1, 2], ['a', 'b']]    # does not work
</code></pre></div>
<p dir="auto">You don't have this with an index without duplicates.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: df = pd.DataFrame(np.random.randn(9,2), index=[1,1,1,2,2,2,3,3,3], colum
ns=['a', 'b'])

In [2]: df
Out[2]:
          a         b
1  0.714735 -1.125141
1  0.061066 -0.737312
1  0.269988  1.434862
2  0.336829  1.040681
2  0.929521 -1.142978
2  0.272813 -0.370184
3 -0.520348  1.126233
3  0.232261 -0.075287
3 -0.314570 -2.635400

[9 rows x 2 columns]

In [3]: df.loc[[1, 2]]
Out[3]:
          a         b
1  0.714735 -1.125141
1  0.061066 -0.737312
1  0.269988  1.434862
2  0.336829  1.040681
2  0.929521 -1.142978
2  0.272813 -0.370184

[6 rows x 2 columns]

In [4]: df.loc[:,['a', 'b']]
Out[4]:
          a         b
1  0.714735 -1.125141
1  0.061066 -0.737312
1  0.269988  1.434862
2  0.336829  1.040681
2  0.929521 -1.142978
2  0.272813 -0.370184
3 -0.520348  1.126233
3  0.232261 -0.075287
3 -0.314570 -2.635400

[9 rows x 2 columns]

In [5]: df.loc[[1, 2], ['a', 'b']]
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
&lt;ipython-input-5-617013ef905a&gt; in &lt;module&gt;()
----&gt; 1 df.loc[[1, 2], ['a', 'b']]

c:\users\vdbosscj\scipy\pandas-joris\pandas\core\indexing.pyc in __getitem__(sel
f, key)
   1152     def __getitem__(self, key):
   1153         if type(key) is tuple:
-&gt; 1154             return self._getitem_tuple(key)
   1155         else:
   1156             return self._getitem_axis(key, axis=0)

c:\users\vdbosscj\scipy\pandas-joris\pandas\core\indexing.pyc in _getitem_tuple(
self, tup)
    680         # ugly hack for GH #836
    681         if self._multi_take_opportunity(tup):
--&gt; 682             return self._multi_take(tup)
    683
    684         # no shortcut needed

c:\users\vdbosscj\scipy\pandas-joris\pandas\core\indexing.pyc in _multi_take(sel
f, tup)
    726             return o.reindex(**d)
    727         except:
--&gt; 728             raise self._exception
    729
    730     def _convert_for_reindex(self, key, axis=0):

KeyError:"><pre class="notranslate"><code class="notranslate">In [1]: df = pd.DataFrame(np.random.randn(9,2), index=[1,1,1,2,2,2,3,3,3], colum
ns=['a', 'b'])

In [2]: df
Out[2]:
          a         b
1  0.714735 -1.125141
1  0.061066 -0.737312
1  0.269988  1.434862
2  0.336829  1.040681
2  0.929521 -1.142978
2  0.272813 -0.370184
3 -0.520348  1.126233
3  0.232261 -0.075287
3 -0.314570 -2.635400

[9 rows x 2 columns]

In [3]: df.loc[[1, 2]]
Out[3]:
          a         b
1  0.714735 -1.125141
1  0.061066 -0.737312
1  0.269988  1.434862
2  0.336829  1.040681
2  0.929521 -1.142978
2  0.272813 -0.370184

[6 rows x 2 columns]

In [4]: df.loc[:,['a', 'b']]
Out[4]:
          a         b
1  0.714735 -1.125141
1  0.061066 -0.737312
1  0.269988  1.434862
2  0.336829  1.040681
2  0.929521 -1.142978
2  0.272813 -0.370184
3 -0.520348  1.126233
3  0.232261 -0.075287
3 -0.314570 -2.635400

[9 rows x 2 columns]

In [5]: df.loc[[1, 2], ['a', 'b']]
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
&lt;ipython-input-5-617013ef905a&gt; in &lt;module&gt;()
----&gt; 1 df.loc[[1, 2], ['a', 'b']]

c:\users\vdbosscj\scipy\pandas-joris\pandas\core\indexing.pyc in __getitem__(sel
f, key)
   1152     def __getitem__(self, key):
   1153         if type(key) is tuple:
-&gt; 1154             return self._getitem_tuple(key)
   1155         else:
   1156             return self._getitem_axis(key, axis=0)

c:\users\vdbosscj\scipy\pandas-joris\pandas\core\indexing.pyc in _getitem_tuple(
self, tup)
    680         # ugly hack for GH #836
    681         if self._multi_take_opportunity(tup):
--&gt; 682             return self._multi_take(tup)
    683
    684         # no shortcut needed

c:\users\vdbosscj\scipy\pandas-joris\pandas\core\indexing.pyc in _multi_take(sel
f, tup)
    726             return o.reindex(**d)
    727         except:
--&gt; 728             raise self._exception
    729
    730     def _convert_for_reindex(self, key, axis=0):

KeyError:
</code></pre></div>