This project main aim is to do some analysys on ipl data sets along with unit testing in python This project analyzes IPL (Indian Premier League) match data from 2008 to 2016, generating visualizations based on matches and deliveries datasets. It includes four Python scripts to address specific analysis tasks and along with unit testing .
- Data Source:
data/matches.csvanddata/deliveries.csvcontain match and ball-by-ball data. - Scripts: Located in
src/, each script computes and plots a specific metric:matches_per_year.py: Total matches played per year.wins_per_team.py: Stacked bar chart of matches won by teams per year.extra_runs_2016.py: Extra runs conceded per team in 2016.top_bowlers_2015.py: Top 10 economical bowlers in 2015.
- Outputs: Plots saved in
outputs/as PNG files.
- Python 3.x
- Required packages:
matplotlib
-
Clone the Repository:
git clone <repository-url> cd project
-
Install Dependencies:
pip install -r requirements.txt
-
Prepare Data:
- Place
matches.csvanddeliveries.csvin thedata/directory. - Ensure
outputs/directory exists (create withmkdir outputsif needed).
- Place
Run each script individually to generate plots and view results:
python src/matches_per_year.py # Q1: Matches per year
python src/wins_per_team.py # Q2: Wins per team (stacked bar)
python src/extra_runs_2016.py # Q3: Extra runs in 2016
python src/top_bowlers_2015.py # Q4: Top 10 economical bowlers in 2015- Output plots are saved in
outputs/(e.g.,q01_total_ipl_matches_played.png). - Console output includes computed data (e.g., dictionaries, lists).
Each script includes unit tests. Run tests and check coverage:
pip install coverage
coverage run src/matches_per_year.py
coverage run --append src/wins_per_team.py
coverage run --append src/extra_runs_2016.py
coverage run --append src/top_bowlers_2015.py
coverage report -m- Data: Ensure CSV files are complete for accurate results.
- Dependencies: Only
matplotlibis required; nopandasis used. - License: [Add license if applicable, e.g., MIT]
- Last Updated: August 26, 2025, 05:15 PM IST
Feel free to fork and submit pull requests. Report issues via the repository.