Skip to content

DEPR: string indexing along index for datetimes #36179

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

Merged
merged 15 commits into from
Sep 24, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
catch warnings
  • Loading branch information
jbrockmendel committed Sep 11, 2020
commit 47bfa61b6e510ac7c1e369c1b9001d5526de6812
9 changes: 7 additions & 2 deletions pandas/tests/series/indexing/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from pandas import DataFrame, DatetimeIndex, NaT, Series, Timestamp, date_range
import pandas._testing as tm


"""
Also test support for datetime64[ns] in Series / DataFrame
"""
Expand Down Expand Up @@ -605,7 +606,9 @@ def test_indexing():
expected.name = "A"

df = DataFrame(dict(A=ts))
result = df["2001"]["A"]
with tm.assert_produces_warning(FutureWarning):
# GH#36179 string indexing on rows for DataFrame deprecated
result = df["2001"]["A"]
tm.assert_series_equal(expected, result)

# setting
Expand All @@ -615,7 +618,9 @@ def test_indexing():

df.loc["2001", "A"] = 1

result = df["2001"]["A"]
with tm.assert_produces_warning(FutureWarning):
# GH#36179 string indexing on rows for DataFrame deprecated
result = df["2001"]["A"]
tm.assert_series_equal(expected, result)

# GH3546 (not including times on the last day)
Expand Down