Created
December 22, 2018 19:28
-
-
Save jes-moore/d1cb7f5bf0426a3bcfe6f6c508a869a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reb_goals = shot_df_agg2.loc[shot_df_agg2.shotTimeDiff <= 3, 'numGoals'].sum() | |
reb_shots = shot_df_agg2.loc[shot_df_agg2.shotTimeDiff <= 3, 'numShots'].sum() | |
norm_goals = shot_df_agg2.loc[shot_df_agg2.shotTimeDiff > 3, 'numGoals'].sum() | |
norm_shots = shot_df_agg2.loc[shot_df_agg2.shotTimeDiff > 3, 'numShots'].sum() | |
## Data | |
data = go.Bar( | |
x=['Shots', 'Goals'], | |
y=[reb_shots / norm_shots, reb_goals / norm_goals], | |
name='Goal Count') | |
## Layout | |
layout = go.Layout( | |
title='Rebound as a Proportion of Total (Shots and Goals)', | |
height=400, | |
width=800) | |
#Fig and Plot | |
fig = go.Figure(data=[data], layout=layout) | |
iplot(fig) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment