Alrighty, let's kick off.
So the first thing that I want to do for
the data preparation is getting just the adjusted close.
Getting the adjusted close because as when we did Bitcoin, we just got the
adjusted close.
So this is what we need to do.
It's super, super simple because if anything, it's right here at the start.
So X equals to X dot I lock open square brackets, colon, comma.
And then here I need to create something dynamic because currently I have one,
two, three, four, five, six, seven, eight.
And imagine if I were to have ten.
I don't want to be counting all the time.
Imagine if I were to have ninety nine.
I mean, I don't want to be counting.
The way to do it is all the way up until
and then we count the tickers that we have here.
How to do it?
And let me actually show you here below.
If I do the length of stocks, there you go.
Control enter.
I get eight.
So this is our sort of dynamic, but also
very simple.
So we write here length or lend and then stocks.
Here we go.
Let's do X dot head with just one observation.
And here we have it.
One, two, three, four, five, six, seven, eight.
Super, super simple.
Next up, let's remove this adjusted close.
And the way that we can do it is removing level.
And this is how it is called.
Let me also bump this X dot columns because now with this or X dot columns.
So let me actually do control enter.
Then here we're just referring this and
it's even a multi index.
So X dot columns.
And then I do X dot columns and then I do drop level.
Here we go.
And same thing.
X dot head with one.
And here we have it.
So we remove the adjusted close.
Next layer of data preparation.
There's been an issue that I've gotten recently.
And this is why I'm also addressing it
now, which is with the time zones.
And the way that we want it is that we
don't want time zones.
So X dot index.
And here so equals to X or variant.
Let me do control enter to show you the X
dot index.
And we have just here the dates.
And here we are just going to tell Python, hey, we don't have any time zones.
Time zone and the score localize.
And then I just include none.
Let me then do X dot index to show you what we get out of it.
Control enter.
So nothing really changes, but now it
knows that no time zone.
I would highlight this frequency equals
to be here and it's super tiny.
But it's just telling us that the
frequency is business days, which is also quite cool.
Let's go here now.
And we now combine everything and the way
that it works.
So we create this data frame and use the
concatenation function from pandas.
And then we include the Y and X.
We specify.
So access equals to one.
And then lastly, because we may still have some N .A .S.
Because maybe you don't know, but Bitcoin, you can trade it every single
day and the stocks is just a business days.
And this means that there's a mismatch here.
As a result, what we do is drop an A so that we always have.
Yeah, the same amounts of rows in both of the items being concatenated.
Let's do it.
Data frame that has control enter.
And here we have it.
And we are going to stop here because in
a sense, we have prepared just the data frame.
And now it's time that we prepare it for
the other assumption, which is the parallel trans assumption.
Let's kick it off in the next video.
Until then, have fun.