IndexError when indexing numpy array with boolean Series · Issue #6168 · pandas-dev/pandas (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
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