image_output_1.png
import pandas as pd # for data manipulation/CSV I/O

deliveries = pd.read_csv('../input/deliveries.csv')
matches = pd.read_csv('../input/matches.csv')

Batsman_score = deliveries.groupby('batsman')['batsman_runs'].agg(sum).reset_index().sort_values(by='batsman_runs', ascending=False).reset_index(drop=True)
Top_batsman_score = Batsman_score.iloc[:15, :]
Top_batsman_score

Batsman_Ball_faced = deliveries.groupby(['batsman'])['ball'].count().reset_index().sort_values(by='ball', ascending=False).reset_index(drop=True)
Batsman_Ball_faced_Top = Batsman_Ball_faced.iloc[:15, :]

Batsman_dotballs = deliveries[deliveries['extra_runs'] == 0].groupby(['batsman'])['batsman_runs'].agg(lambda x: (x == 0).sum()).reset_index().sort_values(by='batsman_runs', ascending=False).reset_index(drop=True)
Batsman_dotballs.columns = ['batsman', 'No_of_Balls']
Batsman_dotballs.iloc[:20, :]