-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
DEPR: row-based indexing in DataFrame.__getitem__ #31334
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's first discuss this a bit more, as this is a huge change. (I am personally -1 on changing this I think)
|
@jorisvandenbossche discussion notwithstanding, can i get your help in troubleshooting the doc build? i put in "okwarnings" to fix the previous set of failures, not clear on why dft_minute is now undefined |
| .. ipython:: python | ||
| :okwarning: | ||
| dft_minute = pd.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the whitespace alignment is off here (:okwarning: and dft_minute... should be vertically aligned)
TomAugspurger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbrockmendel can you give examples of what user-facing behavior is being deprecated? I'd be in favor of deprecating fallback indexing for partial string slicing dataframes with datetime indexes
In [18]: df = pd.DataFrame({"A": [1, 2]}, index=pd.date_range('2000', periods=2))
In [19]: df['2000']
Out[19]:
A
2000-01-01 1
2000-01-02 2| for label-based row indexing. | ||
|
|
||
| .. ipython:: python | ||
| :okwarning: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this cause a warning? It's using loc so I wouldn't think it would.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i took the kitchen-sink approach to getting the docbuild passing, will figure out which of these can be trimmed away
|
Repeating what I said above again: please open an issue first to discuss this. |
|
iirc there is an issue about this (though woudl have to search) |
|
The issue Brock mentioned is #9595, but that is much broader (about |
i believe there is a specific issue this was discussed long ago |
Exactly the example you gave. The relevant cases are where we have all of the following:
(these conditions are basically psuedo-code for |
|
closing to clear the queue, will reivisit |
Discussed recently in #9595. The two tests this edits are the only two that go down this path AFAICT.