Skip to content

IndexError when indexing numpy array with boolean Series #6168

Closed
@stefsmeets

Description

@stefsmeets

Previously (version 0.11) it was possible to generate a boolean Series, and use that to index a numpy array. Version 0.13.0 breaks this behaviour and raises "IndexError: unsupported iterator index"

    import numpy as np
    import pandas as pd    

    rng = np.arange(5)

    rng[rng > 2]                       # works as expected
    >>> array([3, 4])

    b = pd.Series(rng > 2)
    rng[b]                               # doesn't work anymore
    >>> IndexError: unsupported iterator index

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignDuplicate ReportDuplicate issue or pull requestIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions