-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC: Distinguish between different types of boolean indexing #10492
Comments
the soln in this case would be to
which would interpret the 1 as a positional indexer, of course the usual caveats of
However, would appreciate basically this example in the docs section if you would. |
@jcjf pull-request? |
If this issue is still open, i'm going to take. df = pd.DataFrame([[1, 2], [3, 4], [5, 6]], list('abc'), ['column_1', 'column_2'])
sr = (df['column_1'] > 2)
sr
df.loc[sr, df.columns[1]]
df.iloc[sr.values, 1] prose: |
take |
It's not clear from the docs that indexing with a boolean
ndarray
isn't the same as indexing with a booleanSeries
. It took me a while to realise that:I've since read through #3631 and it makes sense to me. However, even though the docs emphasise that
.iloc
is purely integer-based, it didn't click at the time that indexability ofSeries
was the problem I was facing.The text was updated successfully, but these errors were encountered: