Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -135,8 +135,8 @@ with col1:
|
|
135 |
bullpen_var1 = st.selectbox("Which Bullpen are you looking at?", options = bullpen_data['Names'].unique())
|
136 |
working_bullpen = bullpen_data.copy()
|
137 |
bullpen_check = working_bullpen[working_bullpen['Names'] == bullpen_var1]
|
138 |
-
sp_count = st.number_input("How many PA against the Pitcher?")
|
139 |
-
bp_count = st.number_input("How many PA against the Bullpen?")
|
140 |
stat_var1 = st.selectbox("What Stat are you looking at?", options = ['Projected Walks', 'Projected Strikeouts', 'Projected HRs'])
|
141 |
|
142 |
with col2:
|
@@ -153,7 +153,7 @@ with col2:
|
|
153 |
hitter_val = hitter_check['xHRs'].iloc[0] / hitter_check['PA'].iloc[0]
|
154 |
sp_val = pitcher_check['xHRs'].iloc[0] / pitcher_check['PA'].iloc[0]
|
155 |
bp_val = bullpen_check['Homeruns'].iloc[0] / bullpen_check['PA'].iloc[0]
|
156 |
-
value = calc_poisson(hitter_val, sp_val, sp_count, bp_count)
|
157 |
st.write(f"Theoretical mean of the SP instances: {value[0]}")
|
158 |
st.write(f"Theoretical mean of the BP instances: {value[1]}")
|
159 |
st.write(f"Sample mean from generated data: {value[2]}")
|
|
|
135 |
bullpen_var1 = st.selectbox("Which Bullpen are you looking at?", options = bullpen_data['Names'].unique())
|
136 |
working_bullpen = bullpen_data.copy()
|
137 |
bullpen_check = working_bullpen[working_bullpen['Names'] == bullpen_var1]
|
138 |
+
sp_count = st.number_input("How many PA against the Pitcher?", step = 1)
|
139 |
+
bp_count = st.number_input("How many PA against the Bullpen?", step = 1)
|
140 |
stat_var1 = st.selectbox("What Stat are you looking at?", options = ['Projected Walks', 'Projected Strikeouts', 'Projected HRs'])
|
141 |
|
142 |
with col2:
|
|
|
153 |
hitter_val = hitter_check['xHRs'].iloc[0] / hitter_check['PA'].iloc[0]
|
154 |
sp_val = pitcher_check['xHRs'].iloc[0] / pitcher_check['PA'].iloc[0]
|
155 |
bp_val = bullpen_check['Homeruns'].iloc[0] / bullpen_check['PA'].iloc[0]
|
156 |
+
value = calc_poisson(hitter_val, sp_val, bp_val, sp_count, bp_count)
|
157 |
st.write(f"Theoretical mean of the SP instances: {value[0]}")
|
158 |
st.write(f"Theoretical mean of the BP instances: {value[1]}")
|
159 |
st.write(f"Sample mean from generated data: {value[2]}")
|