Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Start a free Basic trial
to watch this video
Bokeh is a popular Python data visualization library. Let's talk a little about Bokeh and what's going to be covered in this course.
-
0:00
[MUSIC]
-
0:04
Hello, I'm Ken.
-
0:07
In this course, I'm excited to introduce you to the Python library, Bokeh.
-
0:12
Bokeh is a Python interactive visualization library
-
0:16
that targets modern web browsers for presentation.
-
0:19
Without using a dedicated Python library power visualizations,
-
0:24
we might rely on a non-Python library, such as D3.js for our work.
-
0:29
Not that there is anything wrong with D3.js, it is a great and
-
0:32
powerful JavaScript library.
-
0:34
However, since we are working in Python already for data processing,
-
0:39
it seems to make sense to stick with our one language if we're able to.
-
0:43
Behind the scenes, Bokeh generates the JavaScript, HTML, and CSS for us.
-
0:49
Therefore, instead of having to manage multiple languages and libraries,
-
0:54
Bokeh consolidates it into one, relatively easy step.
-
1:00
Bokeh allows for interactive data visualization,
-
1:03
so that users can explore data themselves.
-
1:06
This is one reason why I like it better than libraries like Matplotlib,
-
1:10
which has been used for a long time for more basic plotting and charts.
-
1:15
Data visualization is an important part of a variety of developer roles today.
-
1:20
Whether you're doing pie charts in Excel, or
-
1:22
graphing time series data from a scientific experiment,
-
1:26
how you present your data can make a large impact on how people understand the data.
-
1:31
What's important about that, you might ask.
-
1:34
Well, think about what happens when you add a bar chart to a spreadsheet
-
1:37
to quickly determine and visualize your data results.
-
1:41
Spreadsheets are great at displaying rows of data and
-
1:44
their associated column topics.
-
1:46
But they are not super great themselves for seeing if there are patterns in data.
-
1:50
This is where data visualization can help with a variety of charts, bar, line,
-
1:55
pie, for example, or plots, like box, scatter, or candlestick.
-
2:00
Say for example, that we have a spreadsheet table of data that shows miles
-
2:03
per gallon, or MPG of a car, based on the number of cylinders in the engine.
-
2:09
Looking at the table itself can be a daunting task to
-
2:12
come up with any exacting information.
-
2:14
If however, we apply some visualization to our data, we could use a bar graph
-
2:18
to showcase general buckets to see a comparison of MPG to cylinders.
-
2:23
Or a scatter plot, to show each specific entry in our data, and
-
2:27
where it falls in comparison to others.
-
2:29
Or we could visualize the data in a box chart format to
-
2:33
see a more clear comparison of the average, mean, minimum, and
-
2:37
maximum MPG for the various engine sizes.
-
2:40
Bokeh's strength is that it allows for
-
2:42
a wide variety of interactive plots that are quickly and easily generated.
-
2:47
Further, adding interactivity to your visualizations is often a simple process,
-
2:52
and allows for users to examine and explore data further and deeper
-
2:56
without a lot of extra time being spent on the development side of the project.
-
3:01
If we take a quick look at the Bokeh website, we see that there is some good
-
3:04
information in their user guide, especially on how to get started,
-
3:09
as well as some interesting visualization projects available in the gallery section.
-
3:14
I put this link in the teachers notes.
-
3:16
So be sure to check it out to learn more about what Bokeh offers
-
3:20
that we won't be covering in this course.
-
3:22
We'll be relying on some Python libraries.
-
3:25
Like NumPy and pandas to work with our data as well,
-
3:29
showing how to use them with Bokeh's column data source.
-
3:32
But we won’t be going into pandas data frames or numPy arrays.
-
3:36
I'll assume that you have a basic understanding of what they are and
-
3:39
how to generally work with them.
-
3:41
Again, I put links in the teacher's note for a refresher if needed.
-
3:45
There are a lot of public data sets available for exploration.
-
3:48
We're going to be exploring and visualizing world population numbers
-
3:52
from worldwide data.info and their world country population data sets.
-
3:57
The data set we'll be using also includes three-letter country codes added to it,
-
4:01
which will be convenient for use later on.
-
4:05
Now that we have some of the basic project requirements covered,
-
4:07
let's take a quick break before we start looking at some code.
You need to sign up for Treehouse in order to download course files.
Sign up