nesticot commited on
Commit
0a4b3b4
·
verified ·
1 Parent(s): 1471665

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -678,7 +678,7 @@ def server(input, output, session):
678
  "WHIP": f"{df_fg_filter['WHIP'][0]:.2f}",
679
  }
680
  df_table = pd.DataFrame(metrics_data, index=[0])
681
- ax_table.axis('off')
682
  table = ax_table.table(cellText=df_table.values, colLabels=df_table.columns, cellLoc='center', loc='bottom', bbox=[0.07, 0, 0.86, 1])
683
  for key, cell in table.get_celld().items():
684
  if key[0] == 0:
@@ -694,7 +694,7 @@ def server(input, output, session):
694
  ax_bot.axis('off')
695
  ax_bot.text(0.05, 2, "By: Thomas Nestico (@TJStats)", ha="left", va="center", fontsize=14)
696
  ax_bot.text(0.95, 2, "Data: MLB, Fangraphs", ha="right", va="center", fontsize=14)
697
-
698
 
699
  # Player headshot
700
  ax_headshot = fig.add_subplot(gs[1, 1])
@@ -846,6 +846,10 @@ def server(input, output, session):
846
 
847
  df_stuff_filter = df_stuff.filter(pl.col('pitcher_id')==pitcher_id)
848
 
 
 
 
 
849
 
850
 
851
  pitcher_summary_filter = pitcher_summary.filter((pl.col('pa') >= level_dict_filter[str(sport_id)]) & (pl.col('launch_speed') >= 0))
 
678
  "WHIP": f"{df_fg_filter['WHIP'][0]:.2f}",
679
  }
680
  df_table = pd.DataFrame(metrics_data, index=[0])
681
+
682
  table = ax_table.table(cellText=df_table.values, colLabels=df_table.columns, cellLoc='center', loc='bottom', bbox=[0.07, 0, 0.86, 1])
683
  for key, cell in table.get_celld().items():
684
  if key[0] == 0:
 
694
  ax_bot.axis('off')
695
  ax_bot.text(0.05, 2, "By: Thomas Nestico (@TJStats)", ha="left", va="center", fontsize=14)
696
  ax_bot.text(0.95, 2, "Data: MLB, Fangraphs", ha="right", va="center", fontsize=14)
697
+ ax_table.axis('off')
698
 
699
  # Player headshot
700
  ax_headshot = fig.add_subplot(gs[1, 1])
 
846
 
847
  df_stuff_filter = df_stuff.filter(pl.col('pitcher_id')==pitcher_id)
848
 
849
+ df_stuff_filter = df_stuff_filter.with_columns(
850
+ pl.col("tj_stuff_plus").round(0) # Round to the nearest integer
851
+ )
852
+
853
 
854
 
855
  pitcher_summary_filter = pitcher_summary.filter((pl.col('pa') >= level_dict_filter[str(sport_id)]) & (pl.col('launch_speed') >= 0))