-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Unexpected difference between loc and ix #11840
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
Comments
this is by definition of
|
@jreback it's confusing to me that |
@ben519 It is stated here in the docs about |
@jreback What do you exactly mean with:
That it is label vs location based depending on the type of the index? But in this case (integer index), it is label based. Do you know if this difference in behaviour for |
list-based re-indexing (whether they are interpreted as labels or positional) is the original purpose of My point about the label/positional indexing is simply to not use |
Copied from my SO comment... @jreback |
xref: #10695 Agree it's confusing! Although multiple issues at play here |
See my StackOverflow post for details. I've come to the conclusion that this is a bug -
I think
df.loc[[7]]
should not return an error, but should return a dataframe with 1 row for id=7 with NaN values.The text was updated successfully, but these errors were encountered: