yasenov/tv-series-viz
tv-series-viz
Interactive visualizations of 56 TV series episodes IMDB.com ratings powered by Streamlit. It lets you compare shows side-by-side on a normalized season timeline with LOWESS smoothing.
This git repo contains the code to replicate the viz on your machine and gives instructions to add more shows to the database. Utility scripts can also generate static heatmaps and time series PNGs.
Quick start
# 1) Install dependencies
pip install -r requirements.txt
# 2) Run the Streamlit app
streamlit run src/streamlit_app.pyThen open the URL from the terminal (typically http://localhost:8501).
Data format
CSV files live in data/ and must follow this naming pattern and schema:
- Filename:
<show_name>_ratings.csv(lowercase with underscores) - Columns:
episode, season, rating
The app automatically discovers available shows by scanning data/ for files ending with _ratings.csv.
To add a new show:
- Create
data/<your_show>_ratings.csvwith the schema above. - Run or refresh the app. The show will appear in the selector automatically.
Static graphs
You can create PNGs in graphs/ using the helper scripts:
# Heatmaps per show (saved to graphs/heatmaps/)
python code/heatmaps.pyHere is how this looks like for The White Lotus:
# Time series per show (saved to graphs/time_series/)
python code/time_series.pyThis is the plot for the same show:
Notes
- I focus mostly on modern TV drama series with up to seven seasons.
- This dataset contains biases much like any other ratings data. For instance, keep in mind the "survivorship bias" whereby one rates the later episodes within a season (or seasons within a show) only if they like it enough to keep going.
- The app uses absolute paths relative to the repository to find
data/. - LOWESS smoothing is provided by
statsmodels. - Plotly color palettes are chosen to work well on dark backgrounds.
