Background to cricket:
- In 20 20 cricket, each team faces 120 balls or bats until they lose 10 wickets
- A lost wicket can have two effects on total score
- Reduces the total number of balls faced (if 10 wickets fall)
- Tends to reduce the speed a team scores
I am trying to calculate
Change in value, in terms of runs lost, of a wicket falling on each
ball. For example, the difference in total runs if a wicket is taken
on the 10th ball of an innings versus no wicket falling on the tenth
ball
Change in value, in terms of runs lost, for each wicket number falling. For example, the change in value when a team looses their third wicket
A combination of the two, the change in value of loosing each wicket on each ball of an innings. For example, the runs difference in runs when the 3rd wicket is lost on ball 50 of an innings
I have a dataframe where each row represents a ball bowled. We have columns representing:
- The match ID
- The innings
- The over and delivery (each 120 ball innings is split into 20 overs)
- The number of wickets and total runs thus far
- The number of wickets and total runs at the end of the innings
- Weather a wicket falls each ball or not
- The total number of wickets
I am only interested in the change in value in the first innings of the match
Here is code to bring the final score depending on the number of wickets fallen after a specific ball
b1 = df['ball'] ==2.1
b2 = df[b1]
b12 = b2['innings'] ==1
b2[['wickets','t_runs']].groupby('wickets').mean()
Is there a way to extract each ball/wicket combination -> final total run score more efficiently than plugging in different ball values? Could we iterate through each ball or wicket? How about a pivot table
For some situations, there isn't much data. For example, there is nothing on five wickets falling on ball 13 of an innings. How could I predict score when there is a scarcity of samples
question from:
https://stackoverflow.com/questions/65942102/calculating-a-wickets-value-in-20-20-cricket 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…