Phil Salt T20 Career Analysis
Phil Salt T20 Career Analysis
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
In [3]: df.head()
Out[3]:
inns bat bowl ball outcome score out dismissal over cur_bat_runs ... batruns ballfaced bowlruns wagonX wagonY wagonZone
Phil Fawad
0 1 3 six 6 False NaN 7 35 ... 6 1 6 320 306 4
Salt Ahmed
Phil Fawad
1 1 4 no run 0 False NaN 7 35 ... 0 1 0 139 196 6
Salt Ahmed
Phil Fawad
2 1 5 run 1 False NaN 7 36 ... 1 1 1 143 118 8
Salt Ahmed
Phil Fawad
3 1 1 four 4 False NaN 9 48 ... 4 1 4 322 298 3
Salt Ahmed
Phil Fawad
4 1 2 run 1 False NaN 9 49 ... 1 1 1 136 132 7
Salt Ahmed
5 rows × 28 columns
In This Data We Have One Column Called Wagon Zone Which Tells about the area where the shot was
played , but here the data is mentioned in int form , to make it more clear we will make a 'Shot Area'
Attribute which will clearly tell about the part of the ground where the shot was played
In [4]: shot_area_mapping = {
0: 'Null',
1: 'Towards Third Man',
2: 'Towards Fine Leg',
3: 'Towards Square Leg',
4: 'Towards Mid Wicket',
5: 'Towards Long On',
6: 'Towards Long Off',
7: 'Towards Covers',
8: 'Towards Point'
}
df['Shot Area'] = df['wagonZone'].map(shot_area_mapping)
In [5]: df.columns
In [6]: df['batruns'].sum()
Out[6]: 3659
Process To Find How Many Balls Phil Salt Faced
In [7]: df['outcome'].count()
Out[7]: 2471
In [8]: df['outcome'].unique()
Out[8]: array(['six', 'no run', 'run', 'four', 'out', 'bye', 'wide', 'leg bye',
'no ball'], dtype=object)
In [9]: desired_outcomes = [ 'six', 'no run', 'run', 'four', 'out', 'bye', 'leg bye']
df[df['outcome'].isin(desired_outcomes)].count()
Balls Faced By Phil Salt in T20 Cricket from 2020 to Present = 2376
Strike Rate of Phil Salt in T20 Cricket From 2020 To Present is 154.0
In [11]: df['over'].unique()
Out[11]: array([ 7, 9, 5, 6, 8, 10, 3, 1, 4, 2, 14, 11, 13, 12, 15, 16, 17,
18, 19, 20], dtype=int64)
We will break the dataset into three parts - Powerplay ( 1 To 6 Overs), Middle Overs (7 to 15 overs) and
Death Overs (16 To 20 Overs), To Get a better understanding of phil salt strong and weak areas during
the particular phase of innings, so opposition can plan more well accordingly to it
In [12]: pp=[1,2,3,4,5,6]
pp_df = df[df['over'].isin(pp)]
In [13]: mo=[7,8,9,10,11,12,13,14,15]
mo_df = df[df['over'].isin(mo)]
In [14]: death=[16,17,18,19,20]
death_df = df[df['over'].isin(death)]
In [15]: df['wagonZone'].unique()
In [16]: pp_df.head()
Out[16]:
inns bat bowl ball outcome score out dismissal over cur_bat_runs ... ballfaced bowlruns wagonX wagonY wagonZone
Phil Fawad
7 1 1 run 1 False NaN 5 18 ... 1 1 101 291 5 WIDE_
Salt Ahmed
Phil Fawad
8 1 3 six 6 False NaN 5 24 ... 1 6 360 194 3
Salt Ahmed
Phil Fawad
9 1 4 four 4 False NaN 5 28 ... 1 4 17 230 6 WIDE_
Salt Ahmed
Phil Fawad
10 1 5 four 4 False NaN 5 32 ... 1 4 249 350 4 WIDE_
Salt Ahmed
Phil Fawad
11 1 6 run 1 False NaN 5 33 ... 1 1 85 278 5 WIDE_
Salt Ahmed
5 rows × 29 columns
Areas in the ground where phil Salt Mostly Scores in Power Play:
In [17]: pp_df['batruns'].unique()
Different Combinations Of Line-Length In Power Play and Runs Scored along with SR Of Phil Salt On
That Combinations Of Line Length :
In [19]: pp_df['line'].unique()
In [20]: pp_df['length'].unique()
In [21]: pp_df['ballfaced'].unique()
Combinations Of Line Length In Which Phil Salt Gets Dismissed The Most In Power Play:
In [23]: pp_df['dismissal'].unique()
Out[23]: array([nan, 'caught', 'bowled', 'leg before wicket', 'run out', 'stumped'],
dtype=object)
In [24]: dismissals_df = pp_df[pp_df['dismissal'].notna()]
line_length_dismissals = (
dismissals_df.groupby(['line', 'length'])
.size()
.reset_index(name='total_dismissals')
)
line_length_dismissals
Out[24]:
line length total_dismissals
0 DOWN_LEG FULL 1
1 DOWN_LEG SHORT_OF_A_GOOD_LENGTH 2
2 ON_THE_STUMPS FULL 1
3 ON_THE_STUMPS GOOD_LENGTH 11
4 ON_THE_STUMPS SHORT 1
5 ON_THE_STUMPS SHORT_OF_A_GOOD_LENGTH 5
6 OUTSIDE_OFFSTUMP FULL 5
7 OUTSIDE_OFFSTUMP GOOD_LENGTH 17
8 OUTSIDE_OFFSTUMP SHORT 3
9 OUTSIDE_OFFSTUMP SHORT_OF_A_GOOD_LENGTH 6
10 WIDE_OUTSIDE_OFFSTUMP FULL 1
11 WIDE_OUTSIDE_OFFSTUMP GOOD_LENGTH 3
In [25]: dismissals_df = pp_df[pp_df['dismissal'].notna()]
line_length_dismissals = (
dismissals_df.groupby(['line', 'length', 'bowl_kind'])
.size()
.reset_index(name='total_dismissals')
)
line_length_dismissals
Out[25]:
line length bowl_kind total_dismissals
Let's Check What Type Of Shots Phil Salt Plays Against The Outside Off Stump - Good Length
Delivery
In [26]: pp_df['shot'].unique()
Out[27]:
shot total_shots dismissals
0 COVER_DRIVE 70 3
1 CUT_SHOT 23 2
2 DAB 1 0
3 DEFENDED 14 0
4 FLICK 11 2
5 LEFT_ALONE 4 0
6 ON_DRIVE 43 1
7 PULL 4 2
8 PUSH 16 2
9 SLOG_SHOT 16 2
10 SLOG_SWEEP 2 1
11 SQUARE_DRIVE 19 1
12 STEERED 3 1
13 STRAIGHT_DRIVE 6 0
14 SWEEP_SHOT 1 0
We Can See Phil Salt Attempts The Most For Cover Drive, On Drive And Cut Shot Against The Outside Off Stump Good Length Delivery In
PowerPlay And Gets Dismissed Too While Playing Those Shots, So The Best Field Position Strategy For This Delivery Would Be Keeping 1 Slip,
1 Gully, 1 Point, 1 Extra Cover, 1 Cover, 1 Mid Off, 1 Mid Wicket, 1 Long On, 1 Deep Square Leg
Plan B. On The Stumps - Good Length
Reason : * Second Highest Numbar Of Dismissals In Power Play In That Line Length (11)
* In That Line Length His SR Is Only 103.43 In PP,
* As We Have Seen He Scores Around 55% Of His Runs In Power Play Between Square Leg to Long Off R
egion,
So He Will Definetly Try To Play The Middle Stump Ball On The Leg Side Hence It Will Create
Chances For Top Edges And LBW As Those Will Be Cross Batted Shots
Let's See What Shots Phil Salt Attempts The Most In On The Stumps Good Length Ball In Powerplay :
Out[28]:
shot total_shots dismissals
0 COVER_DRIVE 8 0
1 CUT_SHOT 6 1
2 DEFENDED 21 0
3 FLICK 64 5
4 LEFT_ALONE 1 0
5 LEG_GLANCE 2 0
6 ON_DRIVE 36 1
7 PULL 5 1
8 PUSH 11 0
9 REVERSE_SWEEP 1 0
10 SLOG_SHOT 10 2
11 SLOG_SWEEP 1 1
12 SQUARE_DRIVE 2 0
13 STRAIGHT_DRIVE 3 0
14 SWEEP_SHOT 6 0
As We Can See Phil Salt Attempts Flick Shot The Most In PowerPlay In On The Stumps Good Length Ball And Gets Dismissed The Most Also
While Playing It
Lets See In Which Area Of The Ground Does His Flick Shot Goes Against The On The Stumps Good
Length Ball In PowerPlay :
Out[29]:
Shot Area Count
1 Null 12
6 Towards Long On 1
He Got Out 5 Times While Playing Flick Shot In Powerplay Against The On The Stumps Good Length
Ball, Lets Try To See The Pattern In Those Dismissals
Out[30]:
Shot Area dismissal Count
0 Null bowled 1
As I said Earlier Phil Salt Will Try To Play Cross Batted Shots Against The On The Stumps Good Length Ball In Powerplay, Hence It Will Create
Chances For Top Edges, So You Can See His Flicks Got Caught In Long Off And Third Man, This Proves My Point Right
Field Setup For This On The Stumps Good Length Ball Against Phil Salt In Powerplay Considering He Will Try To Play This Ball On Leg Side The
Most And Will Attempt Flick And On Drive The Most Would Be: 1 Mid On, 1 Mid Wicket, 1 Deep Sqaure Leg, 1 Long On, 1 Short Fine Leg, 1
Gully, 1 Point, 1 Cover, 1 Mid Off
Bowling Plans For Phil Salt In Middle Overs :
In [31]: mo_df.head()
Out[31]:
inns bat bowl ball outcome score out dismissal over cur_bat_runs ... ballfaced bowlruns wagonX wagonY wagonZone
Phil Fawad
0 1 3 six 6 False NaN 7 35 ... 1 6 320 306 4 ON_
Salt Ahmed
Phil Fawad
1 1 4 no run 0 False NaN 7 35 ... 1 0 139 196 6 ON_
Salt Ahmed
Phil Fawad
2 1 5 run 1 False NaN 7 36 ... 1 1 143 118 8 OUTSID
Salt Ahmed
Phil Fawad
3 1 1 four 4 False NaN 9 48 ... 1 4 322 298 3 OUTSID
Salt Ahmed
Phil Fawad
4 1 2 run 1 False NaN 9 49 ... 1 1 136 132 7 OUTSID
Salt Ahmed
5 rows × 29 columns
Areas in the ground where phil Salt Mostly Scores in Middle Overs:
Out[32]:
Shot Area Total Runs Scored Percentage of Total Runs
0 Null 0 0.00
Out[34]:
line length bowl_kind total_dismissals
Out[35]:
shot total_shots dismissals
0 COVER_DRIVE 3 0
1 CUT_SHOT 6 3
2 DEFENDED 6 1
3 FLICK 16 1
4 LEG_GLANCE 1 0
5 ON_DRIVE 10 0
6 PULL 6 0
7 PUSH 1 0
8 REVERSE_SWEEP 1 0
9 SLOG_SHOT 3 0
10 SLOG_SWEEP 8 0
11 STRAIGHT_DRIVE 3 1
In [36]: filtered_df_mo = mo_df[(mo_df['line'] == 'ON_THE_STUMPS') &
(mo_df['length'] == 'GOOD_LENGTH') &
(mo_df['bowl_kind'] == 'spin bowler')]
shots_and_dismissals_mo = filtered_df_mo.groupby(['shot', 'dismissal']).agg(
total_shots=('shot', 'size')
).reset_index()
shots_and_dismissals_mo
Out[36]:
shot dismissal total_shots
0 CUT_SHOT bowled 2
1 CUT_SHOT caught 1
2 DEFENDED bowled 1
As We Can Infer From The Data That In Middle Overs If A Spinner Keeps The Ball On The Stumps and Pitch It in Good Length Phil Salt Will Play
That Ball On Leg Side By Flick ,Sweep Or He Will Play It At Long On By On Drive , The Shot Area Data In Middle Overs Clearly Shows He
Scores Around 70% Of His Runs Between Long On To Fine Leg, And By Analyzing His Dismissals Data On That "On The Stump Good Length
Bowl" We Inferred That He Got Dismissed 3 Out Of 6 Times While Playing Cut Shot Out Of Which 2 Were Bowled, So If We Compeletely Pack
The Field On Leg Side And Leave The Point Open For Him To Invite Him To Play Cut Shot Than We Can Get Him Bowled On This "On The
Stump Good Length Bowl"
Apt Field Placement For This 'On The Stumps Good Length Ball' By A Spinner In Middle Overs Is - 1 Third Man, 1 Deep Extra Cover, 1 Long Off,
1 Deep Mid Wicket, 1 Forward Square Leg, 1 Square Leg, 1 Short Fine Leg, 1 Cover And 1 Gully
Plan B. Outside Off Stump - Short Of A Good Length Bowl
Reason : * Got Dismissed 9 Times In Middle Overs In This Type Of Bowl Out Of Which 5 Times By Fast Bo
wler And
4 Times By Spinner
* As Inferred By The Shot Area Data His Off Side Game Is Weak, And In This Delivery Mostly
You Can Score On Off Side Only
Lets See What Shots Does Phil Salt Mosty Play On The Outside Off Stump - Short Of A Good Length
Bowl:
Out[37]:
shot total_shots dismissals
0 COVER_DRIVE 7 0
1 CUT_SHOT 21 1
2 DEFENDED 2 0
3 FLICK 3 0
4 LEFT_ALONE 1 0
5 ON_DRIVE 5 0
6 PULL 29 8
7 PUSH 2 0
8 SLOG_SHOT 2 0
9 STEERED 2 0
10 STRAIGHT_DRIVE 2 0
So According To The Data In Middle Overs Phil Salt Mostly Attempts The Pull Shot Against The Outside Off Stump Short Of A Good Length Bowl,
And Also He Gets Dismissed Mostly Playing That Pull Shot
Lets Try To See The Pattern In Phil Salt Dismisssals While Playing The Pull Shot Against The Outside Off
Stump Short Of A Good Length Bowl
Out[38]:
shot dismissal Shot Area total_shots
So According To This Data In Middle Overs We Can Trap Phil Salt In This Bowl By This Field : 1 Third Man, 1 Deep Point, 1 Cover, 1 Mid Off, 1
Mid On, 1 Deep Mid Wicket, 1 Backward Square Leg, 1 Deep Square Leg, 1 Fine Leg,
Bowling Plans For Phil Salt In Death Overs :
In [39]: death_df.head()
Out[39]:
inns bat bowl ball outcome score out dismissal over cur_bat_runs ... ballfaced bowlruns wagonX wagonY wagonZone
Phil D'Arcy
453 2 1 run 1 False NaN 16 63 ... 1 1 265 204 3
Salt Short
Phil D'Arcy
454 2 3 run 1 False NaN 16 64 ... 1 1 145 245 5
Salt Short
Phil D'Arcy
455 2 5 six 6 False NaN 16 70 ... 1 6 362 261 3
Salt Short
Phil D'Arcy
456 2 6 run 2 False NaN 16 72 ... 1 2 258 249 3
Salt Short
Phil Ben
457 1 1 run 1 False NaN 17 23 ... 1 1 301 253 3 OUT
Salt Laughlin
5 rows × 29 columns
Areas in the ground where phil Salt Mostly Scores in Death Overs:
Out[40]:
Shot Area Total Runs Scored Percentage of Total Runs
0 Null 0 0.00
Out[42]:
line length bowl_kind total_dismissals
0 COVER_DRIVE 8 0
1 CUT_SHOT 9 0
2 CUT_SHOT_ON_BACK_FOOT 1 0
3 DAB 2 0
4 DEFENDED 2 1
5 FLICK 5 2
6 HOOK 1 0
7 LEFT_ALONE 2 0
8 LEG_GLANCE 1 0
9 ON_DRIVE 22 2
10 PADDLE_SWEEP 1 0
11 PULL 18 3
12 PULL_HOOK_ON_BACK_FOOT 5 0
13 PUSH 3 0
14 PUSH_SHOT 2 0
15 RAMP 1 0
16 REVERSE_SWEEP 1 0
17 SLOG_SHOT 10 2
18 SLOG_SWEEP 2 0
19 SQUARE_DRIVE 4 0
20 STEERED 1 0
21 STRAIGHT_DRIVE 4 0
22 SWEEP_SHOT 2 0
23 VERTICAL_FORWARD_ATTACK 6 0
Since Phil Salt Is An Opener So There Is No Such Specific Pattern In Data To See Where He Struggles In Death Overs, Becuase The Data Is
Too Small To Get Into A Conclusion, But Still There Is One Pattern Which Can Be Inferred With The Available Death Over Dataset
Apt Field Placement For This 'On The Stumps - Short Ball' In Death Overs Will Be - 1 Deep Fine Leg, 1 Deep Square Leg, 1 Deep Mid Wicket, 1
Mid On, 1 Long Off, 1 Deep Extra Cover, 1 Point, 1 Short Third Man, 1 Backward Square Leg
In [ ]: