Python Final El
Python Final El
EL PHASE -2
TOPIC:IPL data Analysis using python
Name USN:
Introduction:-
Data analytics is the process of examining, cleaning, transforming, and interpreting data to uncover
meaningful patterns, trends, and insights. It involves using various statistical, mathematical, and
computational techniques to make data-driven decisions and solve complex problems. Data
analytics plays a pivotal role across various domains, including business, finance, healthcare,
marketing, and more
Python is the preferred choice for data analytics due to its extensive ecosystem of specialized libraries
like NumPy, pandas, Matplotlib, Seaborn, and scikit-learn, which streamline data manipulation,
visualization, and machine learning tasks. Its intuitive and readable syntax reduces the learning curve,
making it accessible to both beginners and experienced analysts. Python enjoys robust community
support with abundant documentation and open-source resources, ensuring that analysts have the tools
and knowledge they need. Its cross-platform compatibility and seamless integration capabilities make it
adaptable to various data sources and workflows. Overall, Python's power, simplicity, and community
backing make it the go-to language for extracting insights and making data-driven decisions in the ever-
evolving field of data analytics.
Components used:-
• Loading libraries:
During these IPL seasons, the total runs scored by all teams
combined typically ranged from approximately 18,000 to 23,000
runs in total for the entire season. These numbers can vary from
season to season due to factors like the number of matches
played, batting performances, and scoring trends.
Toss decision percentage
The toss decision (whether to bat or eld rst) can vary from match
to match and is in uenced by various factors including pitch
conditions, team strategy, and the prevailing weather. 60.8% of
toss winners chose elding over 39.2% choosing elding.
fl
fi
fi
fi
fi
Wins for different venues for RCB
These players have had a signi cant impact on their respective teams'
success and have often played crucial roles in match-winning performances.
Starting with CH Gayle at the top, followed by VK Pathan and DA Warner
these are the top players of the winner team in matches overall.
fi
Batsman scoring max number of 1’s,2’s,4’s and 6’s
toppers=deliveriesdf.groupby(['batsman','batsman_runs'])['total_runs'].count().reset_index()
toppers=toppers.pivot('batsman','batsman_runs','total_runs')
fig,ax=plt.subplots(2,2,figsize=(18,12)) toppers[1].sort_values(ascending=False)
[:5].plot(kind='barh',ax=ax[0,0],color='#45ff45',width=0.8) ax[0,0].set_title("Most 1's")
ax[0,0].set_ylabel('') toppers[2].sort_values(ascending=False)
[:5].plot(kind='barh',ax=ax[0,1],color='#df6dfd',width=0.8) ax[0,1].set_title("Most 2's")
ax[0,1].set_ylabel('') toppers[4].sort_values(ascending=False)
[:5].plot(kind='barh',ax=ax[1,0],color='#fbca5f',width=0.8) ax[1,0].set_title("Most 4's")
ax[1,0].set_ylabel('') toppers[6].sort_values(ascending=False)
[:5].plot(kind='barh',ax=ax[1,1],color='#ffff00',width=0.8) ax[1,1].set_title("Most 6's")
ax[1,1].set_ylabel('') plt.show()
Categorising runs as 1s, 2s, 4s and 6s, we compare players scoring most in
each category. For example, Sharma, Raina, Dhoni and Villers stand in the
most 6s category still far behind Gayle’s total 6s. This graph helps us
analyse and compare players according to the run categories.