Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -125,9 +125,9 @@ df_2023 = pd.DataFrame(data=total_list,columns=['player_id','rank_value','full',
|
|
125 |
df_2023['pos_new'] = ['D' if "D" in x else 'F' for x in df_2023['display_position']]
|
126 |
|
127 |
player_games = pd.read_csv('Drive/player_games_cards.csv',index_col=[0]).sort_values(by='date').drop_duplicates(subset=['player_id','date'])
|
128 |
-
summary_2023 = pd.read_csv('Drive/
|
129 |
|
130 |
-
summary_2022 = pd.read_csv('Drive/
|
131 |
team_games = pd.read_csv('Drive/team_games.csv',index_col=[0])
|
132 |
nhl_logos = pd.read_csv("NHL Logos - NHL Logos.csv")
|
133 |
team_games = team_games.merge(right=nhl_logos[['Team Name','Team']],left_on=['team'],right_on=['Team Name'],how='left')
|
@@ -320,7 +320,7 @@ def server(input, output, session):
|
|
320 |
df_career['1st Assist%'] = df_career_total['First_Assists'].sum()/df_career_total['Assists'].sum()
|
321 |
df_career['Off. Zone Start%'] = df_career_total['OZ Start%'].sum()
|
322 |
df_career['oiSH%'] = df_career_total['GF'].sum()/df_career_total['SF'].sum()
|
323 |
-
df_career.rename(index={0:'
|
324 |
df_combined = df_last_games.append([df_season,df_career])
|
325 |
df_combined_t = round(df_combined,3).transpose()
|
326 |
df_combined.style.format(formatter={"IPP": "{:.1%}","S%": "{:.1%}","1st Assist%": "{:.1%}","Off. Zone Start%": "{:.1%}","oiSH%": "{:.1%}"}).set_precision(2)
|
@@ -709,7 +709,7 @@ def server(input, output, session):
|
|
709 |
|
710 |
sub_value = 0.16
|
711 |
ax1.text(x=0.5,y=1.13-sub_value,s='NHL Player Summary',horizontalalignment='center',fontsize=36, fontweight='bold')
|
712 |
-
ax1.text(x=0.5,y=1.08-sub_value,s='
|
713 |
ax1.text(x=0.05,y=1.04-sub_value,s='Player',horizontalalignment='center',fontsize=18,fontname='Century Gothic', fontweight='bold')
|
714 |
ax1.text(x=0.05,y=1.005-sub_value,s='Team',horizontalalignment='center',fontsize=18,fontname='Century Gothic', fontweight='bold')
|
715 |
ax1.text(x=0.05,y=0.97-sub_value,s='Position',horizontalalignment='center',fontsize=18,fontname='Century Gothic', fontweight='bold')
|
@@ -861,9 +861,9 @@ def server(input, output, session):
|
|
861 |
show_values(ax4,stat = values_on,rank_n=rank_3)
|
862 |
|
863 |
|
864 |
-
ax2.text(-0.5, -3.8, '
|
865 |
-
ax3.text(-0.5, -3.8, '
|
866 |
-
ax4.text(-0.5, -3.8, '
|
867 |
|
868 |
|
869 |
ax2.text(-0.5, -4.2, 'Rank (of '+str(len(test_filter))+")", ha="right",fontstyle='italic',zorder=100)
|
@@ -987,7 +987,7 @@ def server(input, output, session):
|
|
987 |
ax6.set_title(label=ax6.get_title(),fontproperties=font_properties_title)
|
988 |
ax7.set_title(label=ax7.get_title(),fontproperties=font_properties_title)
|
989 |
|
990 |
-
ax1.text(x=0.43,y=0.025,s='Note: Last Games compares to
|
991 |
# font_properties_ticks = FontProperties(family='century gothic', size=12)
|
992 |
# ax5.set_xticklabels(ax5.get_xticks(),fontproperties=font_properties_label)
|
993 |
|
|
|
125 |
df_2023['pos_new'] = ['D' if "D" in x else 'F' for x in df_2023['display_position']]
|
126 |
|
127 |
player_games = pd.read_csv('Drive/player_games_cards.csv',index_col=[0]).sort_values(by='date').drop_duplicates(subset=['player_id','date'])
|
128 |
+
summary_2023 = pd.read_csv('Drive/summary_2025.csv',index_col=[0])#.drop_duplicates(subset=['player_id'])
|
129 |
|
130 |
+
summary_2022 = pd.read_csv('Drive/summary_2024.csv',index_col=[0])
|
131 |
team_games = pd.read_csv('Drive/team_games.csv',index_col=[0])
|
132 |
nhl_logos = pd.read_csv("NHL Logos - NHL Logos.csv")
|
133 |
team_games = team_games.merge(right=nhl_logos[['Team Name','Team']],left_on=['team'],right_on=['Team Name'],how='left')
|
|
|
320 |
df_career['1st Assist%'] = df_career_total['First_Assists'].sum()/df_career_total['Assists'].sum()
|
321 |
df_career['Off. Zone Start%'] = df_career_total['OZ Start%'].sum()
|
322 |
df_career['oiSH%'] = df_career_total['GF'].sum()/df_career_total['SF'].sum()
|
323 |
+
df_career.rename(index={0:'2023-24 ('+str(df_career.Games[0])+'GP)'},inplace=True)
|
324 |
df_combined = df_last_games.append([df_season,df_career])
|
325 |
df_combined_t = round(df_combined,3).transpose()
|
326 |
df_combined.style.format(formatter={"IPP": "{:.1%}","S%": "{:.1%}","1st Assist%": "{:.1%}","Off. Zone Start%": "{:.1%}","oiSH%": "{:.1%}"}).set_precision(2)
|
|
|
709 |
|
710 |
sub_value = 0.16
|
711 |
ax1.text(x=0.5,y=1.13-sub_value,s='NHL Player Summary',horizontalalignment='center',fontsize=36, fontweight='bold')
|
712 |
+
ax1.text(x=0.5,y=1.08-sub_value,s='2024-25 Season',horizontalalignment='center',fontsize=28,fontname='Century Gothic', fontstyle='italic')
|
713 |
ax1.text(x=0.05,y=1.04-sub_value,s='Player',horizontalalignment='center',fontsize=18,fontname='Century Gothic', fontweight='bold')
|
714 |
ax1.text(x=0.05,y=1.005-sub_value,s='Team',horizontalalignment='center',fontsize=18,fontname='Century Gothic', fontweight='bold')
|
715 |
ax1.text(x=0.05,y=0.97-sub_value,s='Position',horizontalalignment='center',fontsize=18,fontname='Century Gothic', fontweight='bold')
|
|
|
861 |
show_values(ax4,stat = values_on,rank_n=rank_3)
|
862 |
|
863 |
|
864 |
+
ax2.text(-0.5, -3.8, '2024-25', ha="right",fontstyle='italic',zorder=1)
|
865 |
+
ax3.text(-0.5, -3.8, '2024-25', ha="right",fontstyle='italic')
|
866 |
+
ax4.text(-0.5, -3.8, '2024-25', ha="right",fontstyle='italic')
|
867 |
|
868 |
|
869 |
ax2.text(-0.5, -4.2, 'Rank (of '+str(len(test_filter))+")", ha="right",fontstyle='italic',zorder=100)
|
|
|
987 |
ax6.set_title(label=ax6.get_title(),fontproperties=font_properties_title)
|
988 |
ax7.set_title(label=ax7.get_title(),fontproperties=font_properties_title)
|
989 |
|
990 |
+
ax1.text(x=0.43,y=0.025,s='Note: Last Games compares to 2024-25. 2024-25 compares to 2024-25.',horizontalalignment='center',fontsize=12,fontname='Century Gothic')
|
991 |
# font_properties_ticks = FontProperties(family='century gothic', size=12)
|
992 |
# ax5.set_xticklabels(ax5.get_xticks(),fontproperties=font_properties_label)
|
993 |
|