I am new to Python and I have a dataset S2
including dates. When I use the command:
available_datapoints = S2.index,
then
print(available_datapoints)
yields:
<class 'pandas.tseries.index.DatetimeIndex'>
[2017-05-07 00:00:00+00:00, ..., 2017-07-27 23:50:00+00:00]
Length: 11808, Freq: 10T, Timezone: UTC stop
However Instead of 2017-05-07 00:00:00+00:00
, I want to start 2017-11-07 00:00:00+00:00
and instead of 2017-07-27 23:50:00+00:00
, I want to stop 2017-07-22 23:50:00+00:00
.
Anyone knows how I change this?
I think you can use
DataFrame.truncate
: