You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
__getitem__ with date string key interprets a string label in the index's timezone when none provided, but __getitem__ with date string slices and __setitem__ with string label/slices do not
In [1]: importpandasaspIn [2]: importnumpyasnpIn [3]: index=p.date_range("2012-01-01", "2012-01-02",
...: freq='60min', tz='US/Eastern')
In [4]: ts=p.Series(np.random.randn(len(index)), index)
In [5]: ts["2012-01-01 15:00:00":"2012-01-02 01:00:00"] \
...: # off by five hoursOut[5]:
2012-01-0110:00:00-05:00-1.2943432012-01-0111:00:00-05:00-0.0912182012-01-0112:00:00-05:000.0490172012-01-0113:00:00-05:00-1.0688932012-01-0114:00:00-05:00-0.4703172012-01-0115:00:00-05:000.8947622012-01-0116:00:00-05:000.2230702012-01-0117:00:00-05:00-0.4149072012-01-0118:00:00-05:00-0.9257032012-01-0119:00:00-05:000.8792052012-01-0120:00:00-05:00-1.580123Freq: 60TIn [6]: ts["2012-01-01 20:00:00"] # okOut[6]: -1.5801231823927993In [7]: ts["2012-01-01 15:00:00"] # okOut[7]: 0.89476211630990787In [8]: ts["2012-01-01 20:00:00"] =1# off by five hoursIn [9]: ts["2012-01-01 20:00:00"]
Out[9]: -1.5801231823927993In [10]: ts["2012-01-01 15:00:00"]
Out[10]: 1.0In [11]: ts["2012-01-01 20:00:00-05:00"] =1# okIn [12]: ts["2012-01-01 20:00:00"]
Out[12]: 1.0
The text was updated successfully, but these errors were encountered:
__getitem__
with date string key interprets a string label in the index's timezone when none provided, but__getitem__
with date string slices and__setitem__
with string label/slices do notThe text was updated successfully, but these errors were encountered: