Visualizing geographic data with Bokeh
In this section, we are going to create a Bokeh visualization for the states in the USA that have the lowest crime rates. In order to do this, we will render a map of the USA and pinpoint the states that have the lowest crime rates.
The first step is to import the required packages:
from bokeh.sampledata import us_states from bokeh.plotting import figure, show, output_file from bokeh.models import HoverTool
us_states
is a dictionary containing all the information that we need to construct a map of the USA in Bokeh. Additionally, if you wanted to create a map of any other country in Bokeh, you can find the necessary geo data on the web and import the file into your Jupyter Notebook.
The next step is to copy the data into Bokeh so that we can modify the data and delete states that are not significant (if required). Here, we will be deleting Hawaii and Alaska as we are only interested in the states in the mainland United States. We can delete individual states...