Anytime you are exploring a new visualization library, it’s a good idea to start with some data in a domain you are familiar with. The beauty of Bokeh is that nearly any idea you have should be possible. It’s just a matter of how you want to leverage the available tools to do so.
The remaining examples will use publicly available data from Kaggle, which has information about the National Basketball Association’s (NBA) 2017-18 season, specifically:
You can download the data files from the Real Python GitHub repo.
Create a new subdirectory name data inside the the Bokeh directory you created earlier, and save the files there.
- 2017-18_playerBoxScore.csv: game-by-game snapshots of player statistics
- 2017-18_teamBoxScore.csv: game-by-game snapshots of team statistics
- 2017-18_standings.csv: daily team standings and rankings
import pandas as pd # Read the csv files player_stats = pd.read_csv('data/2017-18_playerBoxScore.csv', parse_dates=['gmDate']) team_stats = pd.read_csv('data/2017-18_teamBoxScore.csv', parse_dates=['gmDate']) standings = pd.read_csv('data/2017-18_standings.csv', parse_dates=['stDate'])