Python Final El
Python Final El
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:
In the Indian Premier League (IPL) from 2008 to 2020, the average
runs scored per match varied from season to season. On average,
matches in the IPL typically saw totals between 150 to 170 runs per
team, resulting in a total of around 300 to 340 runs per match.
Total number of runs scored in the seasons
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 field first) can vary from match to
match and is influenced by various factors including pitch conditions,
team strategy, and the prevailing weather. 60.8% of toss winners chose
fielding over 39.2% choosing fielding.
Wins for different venues for RCB
RCB has played their home matches at the M. Chinnaswamy Stadium in Bangalore,
which has been their primary home ground. They have also played some matches at
neutral venues during certain IPL seasons. Their most wins have been at
Chinnaswamy followed by Feroz Shah and Dubai International stadium.
Total runs scored by each team by choosing batting during the toss
These players have had a significant 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.
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.