nesticot commited on
Commit
7099c3e
·
1 Parent(s): 0494ad5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -10,6 +10,7 @@ import matplotlib.lines as mlines
10
  import matplotlib.transforms as mtransforms
11
  import numpy as np
12
  import time
 
13
  #import plotly.express as px
14
  #!pip install chart_studio
15
  #import chart_studio.tools as tls
@@ -64,7 +65,6 @@ import matplotlib.pyplot as plt
64
  from matplotlib.colors import Normalize
65
  from matplotlib import cm
66
  from datetime import date
67
- from urllib.error import HTTPError
68
 
69
  def show_values(axs, orient="v", space=-1,stat = [],rank_n=[]):
70
  def _single(ax):
@@ -203,7 +203,7 @@ def server(input, output, session):
203
  summary_2023_one = summary_2023[summary_2023['player_id']==player_id]
204
  summary_2022_one = summary_2022[summary_2022['player_id']==player_id]
205
 
206
- last_games = min(last_games,summary_2023_one.GP.max())
207
 
208
  name = player_games_one.Player.values[0]
209
 
@@ -610,10 +610,6 @@ def server(input, output, session):
610
  # ax[0][0].imshow(im)
611
 
612
 
613
- # ax[0][0].axis('off')
614
- # ax[1][0].axis('off')
615
- # image = "https://cms.nhl.bamgrid.com/images/headshots/current/168x168/"+str(player_id)+".png"
616
-
617
  try:
618
  image = "https://cms.nhl.bamgrid.com/images/headshots/current/168x168/"+str(player_id)+".png"
619
  im = plt.imread(image)
@@ -624,8 +620,7 @@ def server(input, output, session):
624
  im = plt.imread(image)
625
  else:
626
  raise
627
-
628
-
629
  logo = nhl_logos[nhl_logos.Team==list(player_games_one['Team'])[0]].reset_index().URL[0]
630
  #im = plt.imread('players/'+name+'_'+str(last_games)+'.png')
631
  #ax = fig.add_axes([0,0,1,0.85], anchor='C', zorder=1)
@@ -937,7 +932,6 @@ def server(input, output, session):
937
  cell.set_linewidth(0)
938
 
939
 
940
-
941
  #abot.axis('off')
942
  #ax1.set_zorder(2)
943
  fig.tight_layout()
 
10
  import matplotlib.transforms as mtransforms
11
  import numpy as np
12
  import time
13
+ from urllib.error import HTTPError
14
  #import plotly.express as px
15
  #!pip install chart_studio
16
  #import chart_studio.tools as tls
 
65
  from matplotlib.colors import Normalize
66
  from matplotlib import cm
67
  from datetime import date
 
68
 
69
  def show_values(axs, orient="v", space=-1,stat = [],rank_n=[]):
70
  def _single(ax):
 
203
  summary_2023_one = summary_2023[summary_2023['player_id']==player_id]
204
  summary_2022_one = summary_2022[summary_2022['player_id']==player_id]
205
 
206
+ last_games = min(last_games,max(summary_2023_one.GP.max()-1,1))
207
 
208
  name = player_games_one.Player.values[0]
209
 
 
610
  # ax[0][0].imshow(im)
611
 
612
 
 
 
 
 
613
  try:
614
  image = "https://cms.nhl.bamgrid.com/images/headshots/current/168x168/"+str(player_id)+".png"
615
  im = plt.imread(image)
 
620
  im = plt.imread(image)
621
  else:
622
  raise
623
+
 
624
  logo = nhl_logos[nhl_logos.Team==list(player_games_one['Team'])[0]].reset_index().URL[0]
625
  #im = plt.imread('players/'+name+'_'+str(last_games)+'.png')
626
  #ax = fig.add_axes([0,0,1,0.85], anchor='C', zorder=1)
 
932
  cell.set_linewidth(0)
933
 
934
 
 
935
  #abot.axis('off')
936
  #ax1.set_zorder(2)
937
  fig.tight_layout()