0% found this document useful (0 votes)
15 views24 pages

SREE

Uploaded by

wizardrakesh055
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)
15 views24 pages

SREE

Uploaded by

wizardrakesh055
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
You are on page 1/ 24

PM SHRI KENDRIYA VIDYALAYA PORT TRUST

NO.3 KOCHI

ACADEMIC YEAR:2024-25
PROJECT REPORT
INFORMATICS PRACTICES

MEMBERS:

VALLEPU RAKESH
V M SREEPRIYA
CERTIFICATE
This is to certify that the contents of this project file
submitted by V M Sreepriya, Roll No of
class XII D Commerce for the subject of informatics
practices is her bonafide work submitted to KENDRIYA
VIDYALAYA NO.3 PORT TRUST under the active
guidance of Ms.Vrinda S for partial fulfillment of
requirements for CBSE examination of class XII for the
academic year 2024-25

Teacher in charge Principal

Ms.Vrinda S Mr. Vijayan T


[PGT Computer Science ]

Internal Examiner External Examiner


ABSTRACT
Our ‘IPL data analyser’ helps people to analise ipl data and it also helps the teams
and players to analise their performance.

INTRODUCTION
The Indian Premier League (IPL) stands as one of the most exhilarating cricket
tournaments globally, attracting millions of fans and sports analysts alike. With its
rich history, dynamic teams, and intense matches, the IPL generates a wealth of
data that can be leveraged for insightful analysis.
This project aims to create a comprehensive data analysis system for IPL statistics,
enabling users to insert, update, and delete records seamlessly. Whether you’re
looking to track player performance, team rankings, or match outcomes, this
system will facilitate a robust exploration of the data.

OBJECTIVE
*To find the team that won the most number of matches in a season.
*To find the team that lost the most number of matches in a season. Does winning
toss increases the chances of victory.
*To find the player with the most player of the match awards.

PROBLEMS
*Teams and players finds it difficult to analise their performance,without knowing
how well they performed it becomes difficult for them to further improve it.
*People finds it difficult to know which team has won the most,lost the most in the
season.
SOLUTION
*User can enter their choices according to the menu given to get the results.User
can insert,update or delete the data according to their wish by choosing the option
as per the menu.
*User can also see the visualization of the data as data visualiszation has been
used in this program.

SOFTWARE LOGO
SOURCE CODE
# Importing required libraries
import pandas as pd
import matplotlib.pyplot as plt

# Load the IPL data from the CSV file


csv_file = 'ipl_2024_detailed.csv' # CSV file path

# Read the CSV file into a DataFrame


df = pd.read_csv(csv_file)

# Start the program in an infinite loop until the user decides to


exit
exit_program = False
while not exit_program:
# Display the main menu of options for the user

print("**********************************************
******")
print("* IPL Data Analysis *")

print("**********************************************
******")
print("1. Display Data")
print("2. Insert Data")
print("3. Update Data")
print("4. Delete Data")
print("5. Plot Winners")
print("6. Plot Player of the Match Awards")
print("7. Plot Match Duration Distribution")
print("8. Plot Toss Decision vs Match Result")
print("9. Provide Feedback")
print("10. Exit")

print("**********************************************
******")

# Take the user's choice as input


choice = input("\nEnter your choice: ")

# Option 1: Display the IPL data


if choice == '1':

print("\n############################################
########")
print(" Displaying IPL Data")

print("##############################################
######")
print(df)
print("\n")

# Option 2: Insert new data


elif choice == '2':

print("\n############################################
########")
print(" Insert New Data")

print("##############################################
######")
match_id = int(input("Enter MatchID: "))
team1 = input("Enter Team1: ")
team2 = input("Enter Team2: ")
winner = input("Enter Winner: ")
team1_score = input("Enter Team1 Score: ")
team2_score = input("Enter Team2 Score: ")
player_of_match = input("Enter Player of the Match: ")
venue = input("Enter Venue: ")
date = input("Enter Date (YYYY-MM-DD): ")
match_duration = float(input("Enter Match Duration
(Hours): "))
team1_wickets = int(input("Enter Team1 Wickets: "))
team2_wickets = int(input("Enter Team2 Wickets: "))
team1_overs = float(input("Enter Team1 Overs: "))
team2_overs = float(input("Enter Team2 Overs: "))
toss_winner = input("Enter Toss Winner: ")
toss_decision = input("Enter Toss Decision (Bat/Bowl): ")
match_type = input("Enter Match Type
(League/Playoff/Final): ")
umpires = input("Enter Umpires (comma-separated): ")

new_row = {
'MatchID': match_id,
'Team1': team1,
'Team2': team2,
'Winner': winner,
'Team1 Score': team1_score,
'Team2 Score': team2_score,
'Player of the Match': player_of_match,
'Venue': venue,
'Date': date,
'Match Duration (Hours)': match_duration,
'Team1 Wickets': team1_wickets,
'Team2 Wickets': team2_wickets,
'Team1 Overs': team1_overs,
'Team2 Overs': team2_overs,
'Toss Winner': toss_winner,
'Toss Decision': toss_decision,
'Match Type': match_type,
'Umpires': umpires
}

# Add the new row


df.loc[len(df)] = [
match_id, team1, team2, winner, team1_score,
team2_score,
player_of_match, venue, date, match_duration,
team1_wickets,
team2_wickets, team1_overs, team2_overs, toss_winner,
toss_decision, match_type, umpires
]

# Save the updated DataFrame to the CSV file


df.to_csv(csv_file, index=False)
print(f"\nData inserted successfully for MatchID:
{match_id}\n")

# Option 3: Update existing data


elif choice == '3':

print("\n############################################
########")
print(" Update Data")
print("##############################################
######")
match_id = int(input("Enter MatchID to update: "))
column_name = input("Enter the column name to update
(Team1, Team2, Winner, Team1 Score, Team2 Score, Player of
the Match, Venue, Date, Match Duration (Hours), Team1
Wickets, Team2 Wickets, Team1 Overs, Team2 Overs, Toss
Winner, Toss Decision, Match Type, Umpires): ")
new_value = input("Enter the new value: ")

if column_name in ["Match Duration (Hours)", "Team1


Wickets", "Team2 Wickets", "Team1 Overs", "Team2 Overs"]:
new_value = float(new_value) if
column_name.endswith("Overs") else int(new_value)

# Check if MatchID exists


if match_id in df['MatchID'].values:
df.loc[df['MatchID'] == match_id, column_name] =
new_value
df.to_csv(csv_file, index=False)
print(f"\nData updated successfully for MatchID:
{match_id}\n")
else:
print(f"\nMatchID {match_id} not found.\n")
# Option 4: Delete data
elif choice == '4':

print("\n############################################
########")
print(" Delete Data")

print("##############################################
######")
match_id = int(input("Enter MatchID to delete: "))

# Check if MatchID exists


if match_id in df['MatchID'].values:
df = df[df['MatchID'] != match_id]
df.to_csv(csv_file, index=False)
print(f"\nData deleted successfully for MatchID:
{match_id}\n")
else:
print(f"\nMatchID {match_id} not found.\n")

# Option 5: Plot winners


elif choice == '5':

print("\n############################################
########")
print(" Plotting Winners")

print("##############################################
######")
winner_counts = df['Winner'].value_counts()
plt.figure(figsize=(10, 6))
plt.bar(winner_counts.index, winner_counts.values)
plt.xticks(rotation=90)
plt.title('Number of Wins by Each Team')
plt.xlabel('Teams')
plt.ylabel('Number of Wins')
plt.show()

# Option 6: Plot Player of the Match Awards


elif choice == '6':

print("\n############################################
########")
print(" Plotting Player of the Match Awards")

print("##############################################
######")
player_counts = df['Player of the Match'].value_counts()
plt.figure(figsize=(10, 6))
plt.bar(player_counts.index, player_counts.values)
plt.xticks(rotation=90)
plt.title('Number of Player of the Match Awards')
plt.xlabel('Player')
plt.ylabel('Number of Awards')
plt.show()

# Option 7: Plot match duration distribution


elif choice == '7':

print("\n############################################
########")
print(" Plotting Match Duration Distribution")

print("##############################################
######")
plt.figure(figsize=(10, 6))
plt.hist(df['Match Duration (Hours)'], bins=10, color='blue',
edgecolor='black')
plt.title('Distribution of Match Durations')
plt.xlabel('Match Duration (Hours)')
plt.ylabel('Frequency')
plt.show()

# Option 8: Plot toss decision vs match result


elif choice == '8':
print("\n############################################
########")
print(" Plotting Toss Decision vs Match Result")

print("##############################################
######")
toss_wins = pd.crosstab(df['Toss Decision'], df['Winner'])
toss_wins.plot(kind='bar', stacked=True, figsize=(10, 6))
plt.title('Match Outcomes Based on Toss Decision')
plt.xlabel('Toss Decision')
plt.ylabel('Number of Matches Won')
plt.xticks(rotation=0)
plt.show()

# Option 9: Provide feedback


elif choice == '9':

print("\n############################################
########")
print(" Collecting User Feedback")

print("##############################################
######")
print("\nWe value your feedback! Please rate your
experience with the program:")
print("1. Excellent")
print("2. Good")
print("3. Average")
print("4. Poor")
print("5. Very Poor")
rating = input("\nPlease enter the emoji that best describes
your experience: ")
additional_feedback = input("\nAny additional feedback or
suggestions (optional): ")

feedback_file = open('feedback.txt', 'a')


feedback = f"Rating: {rating}, Comments:
{additional_feedback}"
feedback_file.write(feedback + '\n')
feedback_file.close()

print(f"\nThank you for your feedback! {rating}\n")

# Option 10: Exit the program


elif choice == '10':
print("\nThank you for using the IPL Data Analysis
Program! Goodbye! ")
exit_program = True
# Handle invalid menu choices
else:
print("\nInvalid choice, please try again.\n")

BACKEND
OUTPUT

MENU

DISPLAY DATA
INSERT DATA

UPDATE DATA
DELETE DATA

PLOT WINNER
PLOT PLAYER OF THE MATCH AWARDS
PLOT MATCH DURATION DISTRIBUTOIN
PLOT TOSS DECISION VS MATCH RESULT
PROVIDE FEEDBACK

EXIT
BACKEND UPDATED

REFERENCES
https://datasportsgroup.com/news-article/74282/the-rise-of-sports- analytics/
https://seleritysas.com/blog/2021/03/27/how-is-big-data-analytics- changing-sports/
https://wicky.ai/content/analytics/story-of-one-of-crickets-first-analytics- pioneers/

You might also like