cannot do slice indexing on <class 'pandas.indexes.range.RangeIndex'> with these indexers
<p>It's very strange error to my mind</p>

<pre><code>import numpy as np
import pandas as pd
df = pd.DataFrame({'head': [1, 1,2,2,1,3,2,3,1,1,1,2, 3,3], 
                  'appraisal': [1,2,1,3,1,4,1,5,1,1,2,3,4,5]})
</code></pre>

<p>then</p>

<pre><code>df.loc[df.head, 'appraisal'].mean()
</code></pre>

<p>and</p>

<pre><code>TypeError: cannot do slice indexing on &lt;class 'pandas.indexes.range.RangeIndex'&gt; with these indexers
</code></pre>

<p>But if i change 'head' to for ample 'head_id' it works correct</p>

<pre><code>df = pd.DataFrame({'head_id': [1, 1,2,2,1,3,2,3,1,1,1,2, 3,3], 
                  'appraisal': [1,2,1,3,1,4,1,5,1,1,2,3,4,5]})
df.loc[df.head_id, 'appraisal'].mean()
2.0
</code></pre>

<p>what's wrong?</p>