Multichem commited on
Commit
5f38c80
·
verified ·
1 Parent(s): e6aed42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -33,7 +33,7 @@ def init_conn():
33
  gcservice_account, MLB_Data = init_conn()
34
 
35
  @st.cache_data(ttl = 599)
36
- def init_baselines(long_form, short_form):
37
  sh = gcservice_account.open_by_url(MLB_Data)
38
 
39
  worksheet = sh.worksheet('Hitter_Data (RHP)')
@@ -109,7 +109,10 @@ with col1:
109
  pitcher_var1 = st.selectbox("Which pitcher are you looking at?", options = pitcher_rhh['Names'].unique())
110
  pitcher_check = pitcher_rhh[pitcher_rhh['Names'] == pitcher_var1]
111
  pitcher_hand = pitcher_check['Hand'][0]
112
- hitter_var1 = st.selectbox("What hitter are you looking at?", options = hitter_rhp['Player'].unique())
 
 
 
113
 
114
  with col2:
115
  st.write(pitcher_hand)
 
33
  gcservice_account, MLB_Data = init_conn()
34
 
35
  @st.cache_data(ttl = 599)
36
+ def init_baselines():
37
  sh = gcservice_account.open_by_url(MLB_Data)
38
 
39
  worksheet = sh.worksheet('Hitter_Data (RHP)')
 
109
  pitcher_var1 = st.selectbox("Which pitcher are you looking at?", options = pitcher_rhh['Names'].unique())
110
  pitcher_check = pitcher_rhh[pitcher_rhh['Names'] == pitcher_var1]
111
  pitcher_hand = pitcher_check['Hand'][0]
112
+ if pitcher_hand == 'RHP':
113
+ hitter_var1 = st.selectbox("What hitter are you looking at?", options = hitter_rhp['Player'].unique())
114
+ else:
115
+ hitter_var1 = st.selectbox("What hitter are you looking at?", options = hitter_lhp['Player'].unique())
116
 
117
  with col2:
118
  st.write(pitcher_hand)