Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -138,8 +138,12 @@ with tab3:
|
|
138 |
|
139 |
hold_file = flex_file
|
140 |
overall_file = flex_file
|
141 |
-
salary_file = flex_file
|
142 |
|
|
|
|
|
|
|
|
|
|
|
143 |
overall_file=overall_file.drop(['Player', 'Floor', 'Median', 'Ceiling', 'STD'], axis=1)
|
144 |
overall_file.astype('int').dtypes
|
145 |
|
@@ -166,8 +170,8 @@ with tab3:
|
|
166 |
final_outcomes = players_only[['Player', 'Top_finish', 'Top_5_finish', 'Top_10_finish', '10%', '90%']]
|
167 |
|
168 |
final_Proj = pd.merge(hold_file, final_outcomes, on="Player")
|
169 |
-
final_Proj = final_Proj[['Player', '
|
170 |
-
|
171 |
st.dataframe(final_Proj.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
172 |
|
173 |
with tab4:
|
@@ -194,11 +198,11 @@ with tab4:
|
|
194 |
|
195 |
df.replace("", 0, inplace=True)
|
196 |
|
197 |
-
if
|
198 |
df['Median'] = df['Strikeouts']
|
199 |
-
elif
|
200 |
df['Median'] = df['Wins']
|
201 |
-
elif
|
202 |
df['Median'] = df['Quality_starts']
|
203 |
|
204 |
flex_file = df
|
@@ -209,8 +213,12 @@ with tab4:
|
|
209 |
|
210 |
hold_file = flex_file
|
211 |
overall_file = flex_file
|
212 |
-
salary_file = flex_file
|
213 |
|
|
|
|
|
|
|
|
|
|
|
214 |
overall_file=overall_file.drop(['Player', 'Floor', 'Median', 'Ceiling', 'STD'], axis=1)
|
215 |
overall_file.astype('int').dtypes
|
216 |
|
@@ -237,6 +245,6 @@ with tab4:
|
|
237 |
final_outcomes = players_only[['Player', 'Top_finish', 'Top_5_finish', 'Top_10_finish', '10%', '90%']]
|
238 |
|
239 |
final_Proj = pd.merge(hold_file, final_outcomes, on="Player")
|
240 |
-
final_Proj = final_Proj[['Player', '
|
241 |
-
|
242 |
st.dataframe(final_Proj.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
|
|
138 |
|
139 |
hold_file = flex_file
|
140 |
overall_file = flex_file
|
|
|
141 |
|
142 |
+
overall_players = overall_file[['Player']]
|
143 |
+
|
144 |
+
for x in range(0,total_sims):
|
145 |
+
overall_file[x] = np.random.normal(overall_file['Median'],overall_file['STD'])
|
146 |
+
|
147 |
overall_file=overall_file.drop(['Player', 'Floor', 'Median', 'Ceiling', 'STD'], axis=1)
|
148 |
overall_file.astype('int').dtypes
|
149 |
|
|
|
170 |
final_outcomes = players_only[['Player', 'Top_finish', 'Top_5_finish', 'Top_10_finish', '10%', '90%']]
|
171 |
|
172 |
final_Proj = pd.merge(hold_file, final_outcomes, on="Player")
|
173 |
+
final_Proj = final_Proj[['Player', '10%', 'Median', '90%', 'Top_finish', 'Top_5_finish', 'Top_10_finish']]
|
174 |
+
|
175 |
st.dataframe(final_Proj.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
176 |
|
177 |
with tab4:
|
|
|
198 |
|
199 |
df.replace("", 0, inplace=True)
|
200 |
|
201 |
+
if prop_type_var_sp == 'Strikeouts':
|
202 |
df['Median'] = df['Strikeouts']
|
203 |
+
elif prop_type_var_sp == 'Wins':
|
204 |
df['Median'] = df['Wins']
|
205 |
+
elif prop_type_var_sp == 'Quality_starts':
|
206 |
df['Median'] = df['Quality_starts']
|
207 |
|
208 |
flex_file = df
|
|
|
213 |
|
214 |
hold_file = flex_file
|
215 |
overall_file = flex_file
|
|
|
216 |
|
217 |
+
overall_players = overall_file[['Player']]
|
218 |
+
|
219 |
+
for x in range(0,total_sims):
|
220 |
+
overall_file[x] = np.random.normal(overall_file['Median'],overall_file['STD'])
|
221 |
+
|
222 |
overall_file=overall_file.drop(['Player', 'Floor', 'Median', 'Ceiling', 'STD'], axis=1)
|
223 |
overall_file.astype('int').dtypes
|
224 |
|
|
|
245 |
final_outcomes = players_only[['Player', 'Top_finish', 'Top_5_finish', 'Top_10_finish', '10%', '90%']]
|
246 |
|
247 |
final_Proj = pd.merge(hold_file, final_outcomes, on="Player")
|
248 |
+
final_Proj = final_Proj[['Player', '10%', 'Median', '90%', 'Top_finish', 'Top_5_finish', 'Top_10_finish']]
|
249 |
+
|
250 |
st.dataframe(final_Proj.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|