WEBVTT

00:00.650 --> 00:03.980
Welcome to this video on advance time shifting methods.

00:04.010 --> 00:09.890
And first of all we import pandas then we are working with the S&amp;P 500.

00:09.890 --> 00:16.280
The data set are essentially only with uh the daytime index.

00:16.280 --> 00:23.570
So here we have actually a business day frequency and that's the index here starting at the very last

00:23.570 --> 00:26.630
day of the year nineteen hundred seventy.

00:26.640 --> 00:33.190
And let's assume that for each and every time stamp here we want to get to the next month and day.

00:33.830 --> 00:40.520
So here for the first time stamp but would be the thirty first of January nineteen hundred seventy one

00:41.270 --> 00:44.190
then here for the next time stamps.

00:44.330 --> 00:48.150
It would be the thirty first of January also.

00:48.470 --> 00:55.330
And we can actually get to the next the month and day with the direct pandas method time series that

00:55.370 --> 01:05.900
offsets thought a month and so that is sort of say a month and object and then we can simply get the

01:05.900 --> 01:16.050
month and days by adding this the two hour day time index so here we have for the very first time stamps.

01:16.100 --> 01:22.840
The thirty first of January nineteen hundred seventy one and actually that's the one parameter here.

01:22.940 --> 01:29.930
So we have the end parameter and here we can define whether we want to f uh the next month and or the

01:29.930 --> 01:31.930
second next or third next.

01:32.510 --> 01:40.310
So we could also pass a two to the end parameter and then we should get the second next month and days.

01:40.340 --> 01:48.020
So yea it's that 28 of February nineteen hundred seventy one for the first time stamps here and we can

01:48.020 --> 01:54.920
also get to the immediately preceding month and by as abstracting here the month and object

01:57.460 --> 02:02.590
until we get actually the third is off November nineteen hundred seventy.

02:03.770 --> 02:11.430
Then for the next time stamps that we get to the thirty first of December and so on and actually month

02:11.460 --> 02:20.040
and gives us to the next month and calendar day but we can also get to the next month and business day

02:20.070 --> 02:29.970
with the B month and and obviously the thirty first of January is a Sunday and the third is a Saturday.

02:29.970 --> 02:38.130
So the last the business day of the next month this year the twenty ninth of January then we can also

02:38.130 --> 02:47.640
get to the next the quarter and day with the math that quarter and so for example here it's the thirty

02:47.640 --> 02:54.330
first of March and for example we can also get the second next the year begin day.

02:54.480 --> 02:56.620
So let's have a look here.

02:56.670 --> 03:03.570
So the very next year begin day would be the first of January nineteen hundred seventy one and the second

03:03.720 --> 03:10.330
next this the first of January nineteen hundred seventy two and actually having here the second time

03:10.340 --> 03:11.130
stamp

03:15.720 --> 03:20.060
on the fourth of January nineteen hundred seventy one.

03:20.250 --> 03:21.260
So the second.

03:21.300 --> 03:28.140
Next the year begin day is actually then the first of January nineteen hundred seventy three

03:30.790 --> 03:33.000
So here this.

03:33.200 --> 03:33.670
All right.

03:33.680 --> 03:36.590
Thanks for watching and I'll see you in the next video by.
