Statistical Thinking in Python (Part 1)
Justin Bois
Teaching Professor at the California Institute of Technology
np.percentile(df_swing['dem_share'], [25, 50, 75])
array([ 37.3025, 43.185 , 49.925 ])
import matplotlib.pyplot as plt
import seaborn as sns
_ = sns.boxplot(x='east_west', y='dem_share',
data=df_all_states)
_ = plt.xlabel('region')
_ = plt.ylabel('percent of vote for Obama')
plt.show()
Statistical Thinking in Python (Part 1)