An interactive dashboard for visualizing NBA league statistics throughout history, built with Streamlit and Python. This dashboard allows users to explore NBA league averages per game from 1946-47 to present day, with features for analyzing trends, comparing eras, and viewing player career spans.
All statistics are sourced from Basketball-Reference.com, specifically the NBA League Averages - Per Game section. The data includes both basic and advanced statistics from the 1946-47 season to the present.
- View league averages for various statistics per game
- Compare multiple statistics simultaneously
- Calculate custom ratios between different statistics
- Toggle between linear and logarithmic scales
- Apply moving average smoothing to identify trends
- Filter data by different NBA eras:
- Russell/Wilt Era (1957-1969)
- Magic-Bird Era (1979-1989)
- Jordan Era (1989-1998)
- Post-Jordan / Iso-Heavy Era (1999-2004)
- Analytics Era (2014-2019)
- View significant policy changes:
- Hand-checking banned (2004)
- 3-point line introduced (1979)
- Shot clock introduced (1954)
- Visualize player career spans on the graph
- Compare multiple players' careers simultaneously
- Color-coded career spans for easy identification
- Customizable year range selection
- Option to focus on modern era (since 1970)
- Toggle visibility of policy changes and era backgrounds
- Adjustable smoothing window for trend analysis
- Points
- Field Goal Attempts/Made/Percentage
- Three-Point Attempts/Made/Percentage
- Free Throw Attempts/Made/Percentage
- Rebounds (Offensive/Defensive/Total)
- Assists
- Steals
- Blocks
- Turnovers
- Personal Fouls
- Games Played
- Minutes Played
- Pace Factor (possessions per 48 minutes)
- Effective Field Goal Percentage
- Turnover Percentage
- Offensive Rebound Percentage
- Free Throws Per Field Goal Attempt
- Offensive Rating
- True Shooting Percentage
- Python 3.x
- Streamlit
- Pandas
- Matplotlib
- NumPy
- Clone the repository
- Install the required packages:
pip install streamlit pandas matplotlib numpy
- Run the dashboard:
streamlit run dashboard.py
- Use the sidebar controls to:
- Select statistics to display
- Choose analysis type (single statistics or ratio calculation)
- Filter by era or time range
- Toggle various visualization options
Avg league stats per game.csv
: Contains NBA league averages per game statisticsNBA_Players_Career_Spans.csv
: Contains player career span information (optional)
- Data provided by Basketball-Reference.com
- Built with Streamlit