Session Ready
Exercise

Some exploratory plots of the data

Here, you'll continue your Exploratory Data Analysis by making a simple plot of Life Expectancy vs Fertility for the year 1970.

Your job is to import the relevant Bokeh modules and then prepare a ColumnDataSource object with the fertility, life and Country columns, where you only select the rows with the index value 1970.

Remember, as with the figures you generated in previous chapters, you can interact with your figures here with a variety of tools.

Instructions
100 XP
  • Import output_file and show from bokeh.io, figure from bokeh.plotting, and HoverTool and ColumnDataSource from bokeh.models.
  • Make a ColumnDataSource called source with:
    • 'x' set to the fertility column.
    • 'y' set to the life column.
    • 'country' set to the Country column.
  • For all columns, select the rows with index value 1970. This can be done using data.loc[1970].column_name.