Created
February 20, 2020 08:10
-
-
Save databyjp/03e73449748792eac245fbab13928bde to your computer and use it in GitHub Desktop.
This file contains hidden or 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
top_pl_df_list = list() | |
temp_slugs = season_tot_df[(season_tot_df.fan_ppg > 30) & (season_tot_df.fan_ppg < 40)].slug.unique() | |
for pl_slug in temp_slugs: | |
temp_df = pd.DataFrame(pl_data_dict[pl_slug]) | |
temp_df = add_fan_pts(temp_df) | |
temp_df = temp_df.assign(player=season_tot_df[season_tot_df.slug == pl_slug]['name'].values[0]) | |
top_pl_df_list.append(temp_df) | |
top_pl_df = pd.concat(top_pl_df_list, axis=0) | |
top_pl_df.reset_index(inplace=True, drop=True) | |
# Box plot | |
fig = px.box(top_pl_df, x='player', y='fan_pts', labels={'fan_pts': 'Fantasy Points', 'date': 'Date'}) | |
clean_chart_format(fig, namelocs=[0.9, 0.9]) | |
fig.update_layout(title='Fantasy performance comparison - top players', font=dict(size=10)) | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment