Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -109,11 +109,19 @@ with col1:
|
|
| 109 |
pitcher_var1 = st.selectbox("Which pitcher are you looking at?", options = pitcher_rhh['Names'].unique())
|
| 110 |
working_pitcher = pitcher_rhh.copy()
|
| 111 |
pitcher_check = working_pitcher[working_pitcher['Names'] == pitcher_var1]
|
| 112 |
-
pitcher_hand = pitcher_check['Hand'][0]
|
| 113 |
if pitcher_hand == 'RHP':
|
| 114 |
hitter_var1 = st.selectbox("What hitter are you looking at?", options = hitter_rhp['Player'].unique())
|
|
|
|
|
|
|
| 115 |
else:
|
| 116 |
hitter_var1 = st.selectbox("What hitter are you looking at?", options = hitter_lhp['Player'].unique())
|
|
|
|
|
|
|
| 117 |
|
| 118 |
with col2:
|
| 119 |
-
st.write(pitcher_hand)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
pitcher_var1 = st.selectbox("Which pitcher are you looking at?", options = pitcher_rhh['Names'].unique())
|
| 110 |
working_pitcher = pitcher_rhh.copy()
|
| 111 |
pitcher_check = working_pitcher[working_pitcher['Names'] == pitcher_var1]
|
| 112 |
+
pitcher_hand = pitcher_check['Hand'].iloc[0]
|
| 113 |
if pitcher_hand == 'RHP':
|
| 114 |
hitter_var1 = st.selectbox("What hitter are you looking at?", options = hitter_rhp['Player'].unique())
|
| 115 |
+
working_hitters = hitter_rhp.copy()
|
| 116 |
+
hitter_check = working_hitters[working_hitters['Player'] == hitter_var1]
|
| 117 |
else:
|
| 118 |
hitter_var1 = st.selectbox("What hitter are you looking at?", options = hitter_lhp['Player'].unique())
|
| 119 |
+
working_hitters = hitter_lhp.copy()
|
| 120 |
+
hitter_check = working_hitters[working_hitters['Player'] == hitter_var1]
|
| 121 |
|
| 122 |
with col2:
|
| 123 |
+
st.write(pitcher_hand)
|
| 124 |
+
hitter_val = hitter_check['BB%'].iloc[0]
|
| 125 |
+
sp_val = pitcher_check['BB%'].iloc[0]
|
| 126 |
+
value = calc_poisson(hitter_val, sp_val)
|
| 127 |
+
st.write(value)
|