Skip to content

Modulo (%) operator not supported anymore for Index since 0.15 #9244

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

In 0.14:

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')

now:

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)
<ipython-input-3-de0ac1282c31> in <module>()
----> 1 intidx % 2

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions