import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
dodgers = pd.read_csv("dodgers.csv")
dodgers.head()
sns.boxplot(x="day_of_week", y="attend", data=dodgers, color="gray",
order=["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"])
plt.xticks(rotation="vertical")
dodgers['attend'].max()
dodgers['attend_norm'] = dodgers.apply(lambda x: x['attend']/56000, axis=1)
dodgers['attend_n2'] = (dodgers['attend']/56000)*100
set(dodgers['opponent'].values)
dodgers['opponent'].value_counts()
sns.regplot(x="temp", y="attend_n2", data=dodgers);
sns.scatterplot(x="temp", y="attend_n2", hue="day_of_week", size="skies", palette="Set2", data=dodgers)
sns.scatterplot(x="temp", y="attend_n2", hue="bobblehead", size="skies", palette="Set2", data=dodgers)
with sns.plotting_context("paper"):
sns.scatterplot(x="temp", y="attend", hue="day_of_week", size="skies", palette="Set2", data=dodgers)
plt.title('Attend by Temp')
sns.lmplot(x="temp", y="attend_n2", col="day_of_week", col_wrap=3, data=dodgers);