I have a pandas.DatetimeIndex for an interval ['2018-01-01', '2018-01-04') (start included, end excluded) and freq=1D:
>>> index = pd.DatetimeIndex(start='2018-01-01',
end='2018-01-04',
freq='1D',
closed='left')
DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03'],
dtype='datetime64[ns]',
freq='D')
How can I obtain the correct open end='2018-01-04' attribute again? I need it for a DB query with timestamp ranges.
- There is no
index.end index[-1]returns'2018-01-03'index[-1] + index.freqworks in this case but is wrong forfreq='2D'
from Can pandas.DatetimeIndex remember whether it is closed?
No comments:
Post a Comment