text_plain_output_1.png image_output_1.png
import pandas as pd               # data frames

points = pd.read_csv('../input/points.csv')
serves = pd.read_csv('../input/serves.csv')
rallies = pd.read_csv('../input/rallies.csv')
events = pd.read_csv('../input/events.csv')

df = points.groupby(['winner', 'serve']).count().iloc[:, :1]
df.columns = ['Points Won']
df

df2 = points.groupby(['reason']).count().iloc[:, :1]
df2.columns = ['Points Won']
df2

df3 = points.groupby(['winner', 'reason']).count().iloc[:, :1]
df3.columns = ['Points Won']
df3

print('Segundos de juego: ' + str(points.totaltime.sum()))
print('Minutos de juego: ' + str(points.totaltime.sum() / 60))
print('Porcentaje de juego durante el partido (2h 4m): ' + str(points.totaltime.sum() / 60 / 124 * 100) + ' %')