0% found this document useful (0 votes)
12 views2 pages

IPL Python Source Code Mini Project-1

The document provides a Python source code for analyzing IPL team performance using match and delivery datasets. It includes functionalities to calculate total wins, win percentages, and the impact of toss decisions, along with visualizations such as bar charts and pie charts. Instructions for running the analysis are also provided, including library installation and file placement requirements.

Uploaded by

Sivasakthi Vel
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

IPL Python Source Code Mini Project-1

The document provides a Python source code for analyzing IPL team performance using match and delivery datasets. It includes functionalities to calculate total wins, win percentages, and the impact of toss decisions, along with visualizations such as bar charts and pie charts. Instructions for running the analysis are also provided, including library installation and file placement requirements.

Uploaded by

Sivasakthi Vel
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

IPL TEAM PERFORMANCE ANALYSIS USING PYTHON

Python Source Code

import pandas as pd
import [Link] as plt

# Load datasets
matches = pd.read_csv("[Link]")
deliveries = pd.read_csv("[Link]")

# Display first 5 rows


print([Link]())

# Total matches won by each team


team_wins = matches['winner'].value_counts()

print("\nTeam Wins:\n", team_wins)

# Plot team wins


[Link]()
team_wins.plot(kind='bar')
[Link]("IPL Team Wins")
[Link]("Teams")
[Link]("Number of Wins")
[Link]()

# Toss decision impact


toss_win_match_win = matches[matches['toss_winner'] == matches['winner']]
print("\nToss Win = Match Win Count:", toss_win_match_win.shape[0])

# Win percentage
win_percentage = (team_wins / team_wins.sum()) * 100
print("\nWin Percentage:\n", win_percentage)

# Plot win percentage pie chart


[Link]()
win_percentage.plot(kind='pie', autopct='%1.1f%%')
[Link]("Win Percentage by Teams")
[Link]("")
[Link]()

# Season wise matches


season_matches = matches['season'].value_counts().sort_index()

[Link]()
season_matches.plot(kind='line', marker='o')
[Link]("Season Wise Matches")
[Link]("Season")
[Link]("Matches")
[Link]()
Instructions to Run:
1. Install Python Libraries:
pip install pandas matplotlib

2. Place [Link] and [Link] in the same folder.

3. Run:
python ipl_analysis.py

You might also like