Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1336,85 +1336,85 @@ with tab2:
|
|
| 1336 |
dst_freq['Team'] = dst_freq['Team'].replace(item_list, team_list)
|
| 1337 |
|
| 1338 |
dst_freq = dst_freq[['Player', 'Team', 'Position', 'Salary', 'Proj Own', 'Exposure', 'Edge']]
|
| 1339 |
-
|
| 1340 |
-
|
| 1341 |
-
|
| 1342 |
-
|
| 1343 |
-
|
| 1344 |
-
|
| 1345 |
-
|
| 1346 |
-
|
| 1347 |
-
|
| 1348 |
-
|
| 1349 |
-
|
| 1350 |
-
|
| 1351 |
-
|
| 1352 |
-
|
| 1353 |
-
|
| 1354 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1355 |
st.download_button(
|
| 1356 |
-
label="Export
|
| 1357 |
-
data=convert_df_to_csv(
|
| 1358 |
-
file_name='
|
| 1359 |
mime='text/csv',
|
| 1360 |
)
|
| 1361 |
-
|
| 1362 |
-
|
| 1363 |
-
|
| 1364 |
-
|
| 1365 |
-
|
| 1366 |
-
|
| 1367 |
-
|
| 1368 |
-
|
| 1369 |
-
|
| 1370 |
-
|
| 1371 |
-
|
| 1372 |
-
|
| 1373 |
-
|
| 1374 |
-
|
| 1375 |
-
|
| 1376 |
-
|
| 1377 |
-
|
| 1378 |
-
|
| 1379 |
-
|
| 1380 |
-
|
| 1381 |
-
|
| 1382 |
-
|
| 1383 |
-
|
| 1384 |
-
|
| 1385 |
-
|
| 1386 |
-
|
| 1387 |
-
|
| 1388 |
-
|
| 1389 |
-
|
| 1390 |
-
|
| 1391 |
-
|
| 1392 |
-
|
| 1393 |
-
|
| 1394 |
-
|
| 1395 |
-
|
| 1396 |
-
|
| 1397 |
-
|
| 1398 |
-
|
| 1399 |
-
|
| 1400 |
-
|
| 1401 |
-
|
| 1402 |
-
|
| 1403 |
-
|
| 1404 |
-
|
| 1405 |
-
|
| 1406 |
-
|
| 1407 |
-
|
| 1408 |
-
|
| 1409 |
-
data=convert_df_to_csv(flex_freq),
|
| 1410 |
-
file_name='flex_freq_export.csv',
|
| 1411 |
-
mime='text/csv',
|
| 1412 |
-
)
|
| 1413 |
-
with tab7:
|
| 1414 |
-
st.dataframe(dst_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
| 1415 |
-
st.download_button(
|
| 1416 |
-
label="Export Exposures",
|
| 1417 |
-
data=convert_df_to_csv(dst_freq),
|
| 1418 |
-
file_name='dst_freq_export.csv',
|
| 1419 |
-
mime='text/csv',
|
| 1420 |
-
)
|
|
|
|
| 1336 |
dst_freq['Team'] = dst_freq['Team'].replace(item_list, team_list)
|
| 1337 |
|
| 1338 |
dst_freq = dst_freq[['Player', 'Team', 'Position', 'Salary', 'Proj Own', 'Exposure', 'Edge']]
|
| 1339 |
+
with st.container():
|
| 1340 |
+
if sim_done == 1:
|
| 1341 |
+
player_split_var2 = st.radio("Are you wanting to isolate any lineups with specific players?", ('Full Players', 'Specific Players'))
|
| 1342 |
+
if player_split_var2 == 'Specific Players':
|
| 1343 |
+
find_var2 = st.multiselect('Which players must be included in the lineups?', options = player_freq['Player'].unique())
|
| 1344 |
+
elif player_split_var2 == 'Full Players':
|
| 1345 |
+
find_var2 = static_exposure.Player.values.tolist()
|
| 1346 |
+
if player_split_var2 == 'Specific Players':
|
| 1347 |
+
Sim_Winner_Frame = Sim_Winner_Frame[np.equal.outer(Sim_Winner_Frame.to_numpy(copy=False), find_var2).any(axis=1).all(axis=1)]
|
| 1348 |
+
elif player_split_var2 == 'Full Players':
|
| 1349 |
+
Sim_Winner_Frame = Sim_Winner_Frame
|
| 1350 |
+
|
| 1351 |
+
with st.container():
|
| 1352 |
+
display_winner_dataframe = Sim_Winner_Frame.copy()
|
| 1353 |
+
st.dataframe(display_winner_dataframe.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').background_gradient(cmap='RdYlGn_r', subset=['Own']).format(precision=2), use_container_width = True)
|
| 1354 |
+
|
| 1355 |
+
st.download_button(
|
| 1356 |
+
label="Export Tables",
|
| 1357 |
+
data=convert_df_to_csv(Sim_Winner_Export),
|
| 1358 |
+
file_name='NFL_consim_export.csv',
|
| 1359 |
+
mime='text/csv',
|
| 1360 |
+
)
|
| 1361 |
+
|
| 1362 |
+
with st.container():
|
| 1363 |
+
freq_container = st.empty()
|
| 1364 |
+
tab1, tab2, tab3, tab4, tab5, tab6, tab7 = st.tabs(['Overall Exposures', 'QB Exposures', 'RB Exposures', 'WR Exposures', 'TE Exposures', 'FLEX Exposures', 'DST Exposures'])
|
| 1365 |
+
with tab1:
|
| 1366 |
+
st.dataframe(player_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
| 1367 |
st.download_button(
|
| 1368 |
+
label="Export Exposures",
|
| 1369 |
+
data=convert_df_to_csv(player_freq),
|
| 1370 |
+
file_name='player_freq_export.csv',
|
| 1371 |
mime='text/csv',
|
| 1372 |
)
|
| 1373 |
+
with tab2:
|
| 1374 |
+
st.dataframe(qb_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
| 1375 |
+
st.download_button(
|
| 1376 |
+
label="Export Exposures",
|
| 1377 |
+
data=convert_df_to_csv(qb_freq),
|
| 1378 |
+
file_name='qb_freq_export.csv',
|
| 1379 |
+
mime='text/csv',
|
| 1380 |
+
)
|
| 1381 |
+
with tab3:
|
| 1382 |
+
st.dataframe(rb_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
| 1383 |
+
st.download_button(
|
| 1384 |
+
label="Export Exposures",
|
| 1385 |
+
data=convert_df_to_csv(rb_freq),
|
| 1386 |
+
file_name='rb_freq_export.csv',
|
| 1387 |
+
mime='text/csv',
|
| 1388 |
+
)
|
| 1389 |
+
with tab4:
|
| 1390 |
+
st.dataframe(wr_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
| 1391 |
+
st.download_button(
|
| 1392 |
+
label="Export Exposures",
|
| 1393 |
+
data=convert_df_to_csv(wr_freq),
|
| 1394 |
+
file_name='wr_freq_export.csv',
|
| 1395 |
+
mime='text/csv',
|
| 1396 |
+
)
|
| 1397 |
+
with tab5:
|
| 1398 |
+
st.dataframe(te_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
| 1399 |
+
st.download_button(
|
| 1400 |
+
label="Export Exposures",
|
| 1401 |
+
data=convert_df_to_csv(te_freq),
|
| 1402 |
+
file_name='te_freq_export.csv',
|
| 1403 |
+
mime='text/csv',
|
| 1404 |
+
)
|
| 1405 |
+
with tab6:
|
| 1406 |
+
st.dataframe(flex_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
| 1407 |
+
st.download_button(
|
| 1408 |
+
label="Export Exposures",
|
| 1409 |
+
data=convert_df_to_csv(flex_freq),
|
| 1410 |
+
file_name='flex_freq_export.csv',
|
| 1411 |
+
mime='text/csv',
|
| 1412 |
+
)
|
| 1413 |
+
with tab7:
|
| 1414 |
+
st.dataframe(dst_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
| 1415 |
+
st.download_button(
|
| 1416 |
+
label="Export Exposures",
|
| 1417 |
+
data=convert_df_to_csv(dst_freq),
|
| 1418 |
+
file_name='dst_freq_export.csv',
|
| 1419 |
+
mime='text/csv',
|
| 1420 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|