text_html_output_1.png
from statistics import mean

import matplotlib.pyplot as plt   # visualizations

import pandas as pd               # data frames

import seaborn as sns             # visualizations

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

f, axes = plt.subplots(1,2, figsize=(15, 5))
sns.countplot(x="reason", data=points, ax=axes[0], palette="Set1")
sns.countplot(x="reason", hue='winner',data=points, ax=axes[1] ,palette="Set1")

f, axes = plt.subplots(1, 2, figsize=(15, 5))
sns.countplot(x='strokes', hue='serve', data=points, palette='Set1', ax=axes[0])
sns.countplot(x='strokes', hue='winner', data=points, palette='Set1', ax=axes[1])