-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: GH12050 Setting values on Series using .loc with a TZ-aware DatetimeIndex fails #12054
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
Fix has been derived from similar code in the method _getitem_iterable around line 980 of indexing.py . Somebody with a better knowledge about the interplay of all the functions should comment before merging. |
tests! |
3012661
to
380ba35
Compare
Is this one good enough? Or should I also test for variations? |
@@ -3511,6 +3511,17 @@ def test_loc_setitem_datetime(self): | |||
expected = DataFrame({'one' : [100.0, 200.0]},index=[dt1, dt2]) | |||
assert_frame_equal(df, expected) | |||
|
|||
def test_loc_setitem_datetimeindex(self): |
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.
pls add the full gamut here (get/setitem) and .loc get/set. also make a loop and test index, list-like, single indexer.
(these all work, but covering bases).
put these tests near these existing ones on https://github.com/pydata/pandas/blob/master/pandas/tests/test_indexing.py#L856
pls also add a release note (bug fixes) |
Ready for merging from where i sit. |
merged via 4182105 thanks! |
Fixes #12050 .
Taking just the values of an index object looses the timezone information.