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.
Bokeh/data/
- 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
File: read_nba_data.py
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'])
sion on May 27, 2019
2017-18_teamBoxScore.csv’ downloads correctly from gitub. 2017-18_playerBoxScore.csv and 2017-18_teamBoxScore.csv only show the raw data without column headings and on the screen. So far I have been unable to find these files in Kaggle Any assistance to obtain these files will be welcome.