Exercise

Blocks vs. rebounds

You are working for a sports media agency that produces data journalism content such as blogs, analyses, and visualizations, primarily focused on basketball. The nba dataset has been preloaded for you and contains per-game statistics for basketball players in the 2017 season as well as their team, conference, and a label for their scoring ability.

The agency has asked you to produce a scatter plot displaying the relationship between blocks and rebounds.

Instructions

100 XP
  • Import figure, output_file, and show from the two relevant Bokeh classes.
  • Create a new figure, fig, setting keyword arguments to label the x-axis as "Blocks per Game" and y-axis as "Rebounds per Game".
  • Add circle glyphs, setting x as nba["blocks"] and y as nba["rebounds"].
  • Call the function to produce the plot as an HTML file, setting the filename as "my_first_plot.html", and display the plot.