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.
Este exercício faz parte do curso
Interactive Data Visualization with Bokeh
Instruções do exercício
- Import
figure,output_file, andshowfrom 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
xasnba["blocks"]andyasnba["rebounds"]. - Call the function to produce the plot as an HTML file, setting the
filenameas"my_first_plot.html", and display the plot.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Import required libraries
from ____.____ import ____
from ____.____ import ____, ____
# Create a new figure
fig = ____(x_axis_label="____", y_axis_label="____")
# Add circle glyphs
fig.____(x=____["____"], y=____["____"])
# Call function to produce html file and display plot
____(filename="____")
____(____)