Skip to content

mihirmath/Sports-Reference-Internship-Engineering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Head-to-Head Records Visualization

The Python script in SREngineeringIntern2024.ipynb demonstrates a method to visualize head-to-head records between teams using Pandas. The visualization creates a color-coded matrix representing team performance against each other.

Installation

Ensure Python is installed and then install the required libraries:

pip install pandas

Usage

JSON Data File: Replace data.json with your JSON file containing head-to-head records. Execute the Script: Run the provided Python script in your preferred environment (Jupyter Notebook, Python script, etc.).

How It Works

Data Loading: The script loads head-to-head records from a JSON file into a Pandas DataFrame.
DataFrame Creation: An empty DataFrame is initialized to store the head-to-head records, filled by iterating through each team's data.
Color-Coding Logic: Records are color-coded based on win ratios between teams. The gradient ranges from red (0 wins) to green (all wins).
Visualization: Pandas' styling functionality applies color-coding to DataFrame cells, creating a visual representation of team performance against each other.

Customization

Data Input: Replace data.json with your dataset following the same structure for the script to visualize head-to-head records.

Output

The output is a styled table (DataFrame) presenting head-to-head records between different teams, with colors indicating win ratios.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published