<p dir="auto">In pandas 0.15, a DataFrame's index no longer supports the modulo operator.  I believe the following code used to work under pandas 0.14, but under pandas 0.15, a TypeError indicating "unsupported operand types" is raised:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: import pandas                                                                                                                                                                                                                        

In [2]: print pandas.version.version                                                                                                                                                                                                         
0.15.2

In [3]: df = pandas.DataFrame({ 'i': xrange(10) })                                                                                                                                                                                           

In [4]: df.index                                                                                                                                                                                                                             
Out[4]: Int64Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype='int64')

In [5]: r = df.index % 2                                                                                                                                                                                                                     
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-5-405b698d3a56&gt; in &lt;module&gt;()
----&gt; 1 r = df.index % 2

TypeError: unsupported operand type(s) for %: 'Int64Index' and 'int'

In [6]: r = df.index.to_series() % 2

In [7]: "><pre class="notranslate"><code class="notranslate">In [1]: import pandas                                                                                                                                                                                                                        

In [2]: print pandas.version.version                                                                                                                                                                                                         
0.15.2

In [3]: df = pandas.DataFrame({ 'i': xrange(10) })                                                                                                                                                                                           

In [4]: df.index                                                                                                                                                                                                                             
Out[4]: Int64Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype='int64')

In [5]: r = df.index % 2                                                                                                                                                                                                                     
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-5-405b698d3a56&gt; in &lt;module&gt;()
----&gt; 1 r = df.index % 2

TypeError: unsupported operand type(s) for %: 'Int64Index' and 'int'

In [6]: r = df.index.to_series() % 2

In [7]: 
</code></pre></div>
<p dir="auto">Line 6 shows that a workaround exists, using the to_series() function.</p>
<p dir="auto">This issue is very similar to <a href="https://github.com/pydata/pandas/issues/8608" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/8608/hovercard">Issue #8608</a>, which dealt with other arithemtic operations on an index.  Pandas commit <a href="https://github.com/pydata/pandas/pull/8634/commits">2fcbc7f</a> fixed that issue by adding addition, subtraction, multiplication, division, and unary operators, but not the modulo operator.</p>
<p dir="auto">In 0.14:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: pd.__version__
Out[1]: '0.14.1'

In [2]: intidx = pd.Index(range(10))

In [3]: intidx % 2
Out[3]: Int64Index([0, 1, 0, 1, 0, 1, 0, 1, 0, 1], dtype='int64')"><pre class="notranslate"><code class="notranslate">In [1]: pd.__version__
Out[1]: '0.14.1'

In [2]: intidx = pd.Index(range(10))

In [3]: intidx % 2
Out[3]: Int64Index([0, 1, 0, 1, 0, 1, 0, 1, 0, 1], dtype='int64')
</code></pre></div>
<p dir="auto">now:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: pd.__version__
Out[1]: '0.15.2'

In [2]: intidx = pd.Index(range(10))

In [3]: intidx % 2
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-3-de0ac1282c31&gt; in &lt;module&gt;()
----&gt; 1 intidx % 2

TypeError: unsupported operand type(s) for %: 'Int64Index' and 'int'"><pre class="notranslate"><code class="notranslate">In [1]: pd.__version__
Out[1]: '0.15.2'

In [2]: intidx = pd.Index(range(10))

In [3]: intidx % 2
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-3-de0ac1282c31&gt; in &lt;module&gt;()
----&gt; 1 intidx % 2

TypeError: unsupported operand type(s) for %: 'Int64Index' and 'int'
</code></pre></div>