1
00:00:00,030 --> 00:00:06,690
So now that these data makes sense to you
I can go ahead and explain the candlestick

2
00:00:06,690 --> 00:00:12,719
chart, so as you can see it's not quite
an intuitive chart to read so you need

3
00:00:12,719 --> 00:00:18,270
some time to get a hand of it, but this
chart as you can imagine, this chart

4
00:00:18,270 --> 00:00:25,590
represents this table, these data, so you
can also choose to represent all these

5
00:00:25,590 --> 00:00:31,830
columns as simple line plots, so you'd
have you'd have a chart with four lines

6
00:00:31,830 --> 00:00:35,969
so one for each of these attributes.
Open, high, low, close.

7
00:00:35,969 --> 00:00:43,800
So you could have a line that lies along
the date time axis, so date time as x axis.

8
00:00:43,800 --> 00:00:49,379
And then you have this value so let's
say you have a red line for open and

9
00:00:49,379 --> 00:00:55,110
then you have a green line for high and
then another color for low and

10
00:00:55,110 --> 00:01:01,260
another colorful close, so you'd have a
chart with four lines. So that would be a

11
00:01:01,260 --> 00:01:07,049
simple representation that I'm sure you
can make by yourself, but this chart here

12
00:01:07,049 --> 00:01:12,299
is more difficult.
Actually there are two difficulties

13
00:01:12,299 --> 00:01:17,610
there. The first one as I said is
difficulty in reading this chart so I'll

14
00:01:17,610 --> 00:01:23,460
explain that and the second difficulty
is the way of building this, so as you

15
00:01:23,460 --> 00:01:28,530
can see you have actually two kinds of
glyphs, two kinds of figures here which

16
00:01:28,530 --> 00:01:33,930
are called glyphs in the Bokeh
vocabulary, so you have rectangle glyphs

17
00:01:33,930 --> 00:01:40,049
and which can also be quadrants glyphs,
so you have to choose whether you want

18
00:01:40,049 --> 00:01:45,299
to use quadrants or rectangles to
represent these boxes. And also you have

19
00:01:45,299 --> 00:01:51,420
some lines which could be segments, so
you have to build these glyphs, but

20
00:01:51,420 --> 00:01:55,229
before building them of course as
a developer of this chart you have to

21
00:01:55,229 --> 00:02:01,159
understand what these figures mean, so
here is a table and what I'd like to put

22
00:02:05,610 --> 00:02:11,730
that here so these data are plotted
exactly in this chart, so this chart is

23
00:02:11,730 --> 00:02:16,090
a representation of these data.
Let's start by explaining the first

24
00:02:16,090 --> 00:02:21,820
rectangle, so as you can see the
rectangle has a lower border and an

25
00:02:21,820 --> 00:02:29,230
upper border, so let's say top and bottom.
So the bottom has a value of

26
00:02:29,230 --> 00:02:43,720
somewhere 704 here and 718, 719 maybe,
so 704 which corresponds with this open

27
00:02:43,720 --> 00:02:49,930
value, so this first figure represents
the first row of the data frame, and

28
00:02:49,930 --> 00:02:57,100
every figure represents a row of the
data frame one by one, so as you can

29
00:02:57,100 --> 00:03:05,230
imagine now the bottom of the rectangle
is open price and the top is the closing

30
00:03:05,230 --> 00:03:11,140
price, so these two values, and then you
have the low and the high. The low now is

31
00:03:11,140 --> 00:03:19,480
the lower coordinate, so the lower value
of the segment and the high value is the

32
00:03:19,480 --> 00:03:26,920
upper value of the segment which happens
to be behind the box in this case, so

33
00:03:26,920 --> 00:03:34,150
this is a special case. And then you have
the date so this is for 1st of March so

34
00:03:34,150 --> 00:03:40,290
the month and the day. So before going into
further detail, let's go to another

35
00:03:40,290 --> 00:03:49,660
glyphs, so let's explain this on here.
So the lower border is somewhere at 712 which

36
00:03:49,660 --> 00:03:57,880
is this closing price here, and then 718 for
the open price. So closing price here,

37
00:03:57,880 --> 00:04:03,490
open price here. But for this we had open
price your, closing price here, and that

38
00:04:03,490 --> 00:04:09,070
brings us to the point that a rectangles
colored in red represent those days

39
00:04:09,070 --> 00:04:16,450
where the closing price was lower than
the opening price, which means that for

40
00:04:16,450 --> 00:04:22,240
that particular company the price has
decreased throughout the day, so for this

41
00:04:22,240 --> 00:04:25,639
company, so for Google,
this is a Google company

42
00:04:25,639 --> 00:04:33,470
the opening of the day it was 718 and
then it went down to 712, so you have a

43
00:04:33,470 --> 00:04:44,030
red rectangle, but for this day the price
opened at 703 and it closed at 718.

44
00:04:44,030 --> 00:04:50,690
Si the price was positive for the day.
It went up. That's why you have a different

45
00:04:50,690 --> 00:04:56,870
color, so you have to put the color as well
with Bokeh when you build the chart and

46
00:04:56,870 --> 00:05:01,750
then again you have the segment which
always represents the highest price for

47
00:05:01,750 --> 00:05:07,719
the upper point and the lowest price
for the upper point for that particular day.

48
00:05:07,719 --> 00:05:14,150
And yeah, that's. It it's quite
a sophisticated representation of data and

49
00:05:14,150 --> 00:05:19,400
it can be of great interest if you're
working with stock market data, and if

50
00:05:19,400 --> 00:05:24,530
you're not working with stock market
data then it's still good because you

51
00:05:24,530 --> 00:05:29,690
learn a few tricks with pandas and also
the Bokeh library, so for sure you want

52
00:05:29,690 --> 00:05:35,840
to follow the next lectures. So that's
about explaining things. In the next

53
00:05:35,840 --> 00:05:39,000
lecture we'll go ahead and build
this chart, so see you there!

