WEBVTT

00:00.860 --> 00:06.980
In this video we learn how to create our very first interactive bloodily graph in our Jupiter notebook.

00:07.160 --> 00:11.010
And in principle there are two options how to create a plot graph.

00:11.510 --> 00:18.230
So either you can create and host your properly graph online on the plot platform but for this you need

00:18.230 --> 00:19.700
to create an account.

00:19.910 --> 00:27.220
And the second alternative is that we create and view our graph off line in a two bit and notebook.

00:27.290 --> 00:30.180
And this is exactly what we will do in this course.

00:30.200 --> 00:35.720
So we create the offline properly graphs and therefore there's no need to create an account.

00:36.200 --> 00:42.590
So let's start and we import pen does and the to create a properly graphs.

00:42.620 --> 00:44.990
We simply need to impart cufflinks.

00:44.990 --> 00:48.020
And uh we do this as the CEF.

00:48.440 --> 00:51.590
So this is a convention here.

00:51.590 --> 00:56.050
And then we are importing the stock data from our stocks.

00:56.100 --> 00:59.320
Yes we file and we simply select.

00:59.390 --> 01:01.840
The closing prices.

01:02.000 --> 01:03.790
So let's have a look.

01:03.800 --> 01:09.570
So here we have our six stocks and we've already learned that plotting normalized stock prices.

01:09.570 --> 01:14.590
So for example each and every stock starts at a base value of 100.

01:14.600 --> 01:23.180
So this is actually more meaningful and that's more easy to compare and uh therefore we create the normalized

01:23.190 --> 01:26.160
uh data frame with normalized stock prices.

01:26.180 --> 01:28.540
So this is nothing new here.

01:28.670 --> 01:29.960
And let's have a look.

01:29.960 --> 01:37.310
So we are starting at a stock price of 100 and then we could actually create an interactive price chart

01:37.340 --> 01:38.580
with Flatley.

01:38.840 --> 01:44.050
And we simply have to use uh the I plot method on our data frame.

01:44.060 --> 01:45.500
So let's try this out here.

01:49.620 --> 01:53.970
And if we get an error message so we do not have a user name and an account.

01:54.720 --> 02:01.620
And actually what we tried to do here we tried to plot and to host our plot online on the plot Leh platform.

02:01.830 --> 02:07.920
And this does obviously not work because we didn't create an account and therefore we get an error message

02:07.920 --> 02:08.820
here.

02:08.820 --> 02:15.370
But anyway our plan is to only create an off line graph here and our job at a notebook.

02:15.370 --> 02:22.820
And there are actually two ways how to overcome this problem and how to create off line graphs and there's

02:22.830 --> 02:26.890
a non-permanent way to do this and a permanent way.

02:26.940 --> 02:30.390
And let's go to the non-permanent solution.

02:31.590 --> 02:38.850
So let's create here a new cell and then we can make an instruction that uh we want to create an off

02:38.850 --> 02:45.740
line graph and uh we can do this with the cuff links the method go off line.

02:46.590 --> 02:47.370
So let's have a look.

02:47.370 --> 02:55.830
So here we have uh go off line and we do not need to pass any argument or parameter and let's simply

02:55.830 --> 03:02.060
run the cell here and let's retry it to create yeah our interactive price chart

03:05.560 --> 03:14.520
and uh we can see now that we have successfully created our interactive price chart and of course there's

03:14.520 --> 03:17.530
also the option to go online again.

03:17.780 --> 03:22.850
And no surprise we can do this with the cufflinks method go online

03:27.260 --> 03:29.570
so here we have the method go online.

03:29.570 --> 03:35.270
And if uh we run the method here and if we again try to create our plot

03:38.920 --> 03:45.520
then again we get the error message Yes we try to create our plot online and uh we do not have an account.

03:46.000 --> 03:52.930
So let's uh rerun the go off line method and uh let's again create yeah our graph

03:57.070 --> 03:58.800
so this works.

03:58.800 --> 04:05.330
And before I said that using the go off line method is a non-permanent way how to do this.

04:05.530 --> 04:09.850
And non-permanent means that if we restart the kernel.

04:10.990 --> 04:13.660
So we restart and uh clear the output

04:19.090 --> 04:22.000
and the fear rerun here our code.

04:22.000 --> 04:24.740
So we imported the stocks we normalize that

04:28.920 --> 04:38.710
and now if we do not read run we go offline method and simply tried to create here the interactive graph.

04:38.820 --> 04:41.240
Then again we get to the error message.

04:41.280 --> 04:49.810
So in each and every Jupiter note book session we need to run the go off line code and then it works

04:55.790 --> 05:01.940
so running the go off line method in each and every session is maybe a bit uncomfortable.

05:02.300 --> 05:05.380
And uh there's also a permanent solution.

05:05.750 --> 05:07.800
So let's again restart.

05:07.820 --> 05:09.460
And to clear the output

05:16.050 --> 05:17.460
and uh let's delete.

05:17.480 --> 05:25.250
Yeah our go off line and go online uh sales here and uh let's rerun the other code

05:31.720 --> 05:34.480
so again we are getting here an error message.

05:37.120 --> 05:43.060
And that's actually a permanent solution that we only have to run once.

05:43.060 --> 05:49.810
And uh then if we have uh run the code once uh then in each and every two but an output session then

05:49.840 --> 05:56.800
automatically we can plot our graphs offline without having to explicitly determine that we want to

05:56.800 --> 05:57.460
grow a plot.

05:57.490 --> 06:04.790
The graph off line and we can do this with uh the cuff links method set config file.

06:05.260 --> 06:10.380
So let's do this so give you a further method.

06:10.380 --> 06:12.220
Set config file.

06:12.220 --> 06:18.810
And uh here we have the parameter off line and we have to pass true.

06:20.130 --> 06:26.520
So let's run this out here and let's retry to create our plot here

06:31.600 --> 06:33.740
and now let's delete here the cell.

06:33.760 --> 06:34.690
So we delete.

06:34.720 --> 06:39.370
And then again we restart and uh clear the output

06:45.980 --> 06:48.510
and uh then again we try to run.

06:48.510 --> 06:48.640
Yeah.

06:48.650 --> 06:54.350
Our code without explicitly saying that we want to create an off line graph.

06:55.490 --> 06:57.200
And uh this should work.

06:57.200 --> 06:58.030
Now actually

07:01.380 --> 07:03.060
so let's try this out.

07:08.450 --> 07:10.730
And here we have our graph.

07:10.730 --> 07:17.030
So if you do want to work permanently off line when creating properly graphs then actually the best

07:17.030 --> 07:25.550
solution would be to apply the set config file method once and pass true to the offline parameter and

07:25.670 --> 07:32.000
uh with this we are finished here with this video and in the next video we are starting to create and

07:32.000 --> 07:34.030
analyze our inductive graph.

07:34.030 --> 07:35.480
So hope to see you there by.
