<p dir="auto">I came around this and this seemed related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="59948062" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/9595" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/9595/hovercard" href="https://github.com/pandas-dev/pandas/issues/9595">#9595</a> but could also be a bug in the above interacting with the CategoricalIndex. Using the same example as <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="209270351" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/15470" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/15470/hovercard" href="https://github.com/pandas-dev/pandas/issues/15470">#15470</a> with pandas 0.20.3:</p>
<h4 dir="auto">Code Sample</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    s = pd.Series([2, 1, 0], index=pd.CategoricalIndex([2, 1, 0]))
    s[2]  # works (interpreting as label)
    s.loc[2]  # fails with TypeError: cannot do label indexing on &lt;class 'pandas.core.indexes.category.CategoricalIndex'&gt; with these indexers [2] of &lt;class 'int'&gt;

    # of course the below works!
    s = pd.Series([2, 1, 0], index=[2, 1, 0])
    s[2]  # works (interpreting as label)
    s.loc[2]  # works (interpreting as label)"><pre class="notranslate">    <span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([<span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>], <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">pd</span>.<span class="pl-v">CategoricalIndex</span>([<span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>]))
    <span class="pl-s1">s</span>[<span class="pl-c1">2</span>]  <span class="pl-c"># works (interpreting as label)</span>
    <span class="pl-s1">s</span>.<span class="pl-s1">loc</span>[<span class="pl-c1">2</span>]  <span class="pl-c"># fails with TypeError: cannot do label indexing on &lt;class 'pandas.core.indexes.category.CategoricalIndex'&gt; with these indexers [2] of &lt;class 'int'&gt;</span>

    <span class="pl-c"># of course the below works!</span>
    <span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([<span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>], <span class="pl-s1">index</span><span class="pl-c1">=</span>[<span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>])
    <span class="pl-s1">s</span>[<span class="pl-c1">2</span>]  <span class="pl-c"># works (interpreting as label)</span>
    <span class="pl-s1">s</span>.<span class="pl-s1">loc</span>[<span class="pl-c1">2</span>]  <span class="pl-c"># works (interpreting as label)</span></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto"><code class="notranslate">s.loc[2]</code> shouldn't fail and should select the label '2'.<br>
Note this happens also with a pd.DataFrame.</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="&gt;&gt;&gt; s = pd.Series([2, 1, 0], index=pd.CategoricalIndex([2, 1, 0]))
&gt;&gt;&gt; s.index
CategoricalIndex([2, 1, 0], categories=[0, 1, 2], ordered=False, dtype='category')
&gt;&gt;&gt; s[[0, 1, 2]].equals(s.loc[[0, 1, 2]])  # Should be True
False
&gt;&gt;&gt; s[[0, 1, 2]].equals(s.iloc[[0, 1, 2]])  # Should be False
True"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([<span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>], <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">pd</span>.<span class="pl-v">CategoricalIndex</span>([<span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>]))
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">s</span>.<span class="pl-s1">index</span>
<span class="pl-v">CategoricalIndex</span>([<span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>], <span class="pl-s1">categories</span><span class="pl-c1">=</span>[<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>], <span class="pl-s1">ordered</span><span class="pl-c1">=</span><span class="pl-c1">False</span>, <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'category'</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">s</span>[[<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>]].<span class="pl-en">equals</span>(<span class="pl-s1">s</span>.<span class="pl-s1">loc</span>[[<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>]])  <span class="pl-c"># Should be True</span>
<span class="pl-c1">False</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">s</span>[[<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>]].<span class="pl-en">equals</span>(<span class="pl-s1">s</span>.<span class="pl-s1">iloc</span>[[<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>]])  <span class="pl-c"># Should be False</span>
<span class="pl-c1">True</span></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">For Series with CategoricalIndex, <code class="notranslate">__getitem__</code> indexing behaves differently than <code class="notranslate">.loc</code>. On other-indexed series, these accessors return the same result:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; s = pd.Series([2, 1, 0], index=[2, 1, 0])
&gt;&gt;&gt; s[[0, 1, 2]].equals(s.loc[[0, 1, 2]])  # Should be True
True
&gt;&gt;&gt; s[[0, 1, 2]].equals(s.iloc[[0, 1, 2]])  # Should be True
False"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([<span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>], <span class="pl-s1">index</span><span class="pl-c1">=</span>[<span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>])
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">s</span>[[<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>]].<span class="pl-en">equals</span>(<span class="pl-s1">s</span>.<span class="pl-s1">loc</span>[[<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>]])  <span class="pl-c"># Should be True</span>
<span class="pl-c1">True</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">s</span>[[<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>]].<span class="pl-en">equals</span>(<span class="pl-s1">s</span>.<span class="pl-s1">iloc</span>[[<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>]])  <span class="pl-c"># Should be True</span>
<span class="pl-c1">False</span></pre></div>
<h4 dir="auto">Expected Output</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; s = pd.Series([2, 1, 0], index=pd.CategoricalIndex([2, 1, 0]))
&gt;&gt;&gt; s[[0, 1, 2]].equals(s.loc[[0, 1, 2]])
True"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([<span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>], <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">pd</span>.<span class="pl-v">CategoricalIndex</span>([<span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>]))
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">s</span>[[<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>]].<span class="pl-en">equals</span>(<span class="pl-s1">s</span>.<span class="pl-s1">loc</span>[[<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>]])
<span class="pl-c1">True</span></pre></div>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<p dir="auto">0.19.0+479.git</p>