Spaces:
Running
Running
James McCool
commited on
Commit
·
dc7066d
1
Parent(s):
d2f16b0
Refactor app.py to enhance data presentation and organization. Introduced a new tabbed layout with three tabs: "Overall Data", "Individual Game Data", and "Opponent Data". Improved the display of overall simulations by adding subheaders and individual player tabs for better clarity. Updated the styling for dataframes to maintain a consistent visual theme using the 'RdYlGn' colormap. These changes enhance user experience and readability of simulation results.
Browse files
app.py
CHANGED
@@ -427,37 +427,40 @@ if st.button("Run"):
|
|
427 |
overall_sim_df = pd.DataFrame(overall_sim_results)
|
428 |
overall_sim_df = overall_sim_df.drop_duplicates(subset = ['Player', 'Stat'])
|
429 |
|
430 |
-
tab1, tab2 = st.tabs(["
|
431 |
with tab1:
|
432 |
st.subheader("Full Match Data")
|
433 |
st.dataframe(player_summary.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(display_formats, precision=2), use_container_width = True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
434 |
st.subheader("Individual Game Data")
|
435 |
st.dataframe(team_data.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(display_formats, precision=2), use_container_width = True)
|
436 |
-
with tab2:
|
437 |
-
st.dataframe(opp_boost.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
438 |
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
for stat, tab in zip(["Kills", "Deaths", "Assists", "CS"], stat_tabs):
|
457 |
-
with tab:
|
458 |
-
stat_data = overall_sim_df[overall_sim_df['Stat'] == stat].copy()
|
459 |
-
stat_data = stat_data.set_index('Player')[['Position', '10%', '25%', '50%', '75%', '90%']]
|
460 |
-
st.dataframe(
|
461 |
-
stat_data.style.format(precision=2).background_gradient(axis=0).background_gradient(cmap='RdYlGn'),
|
462 |
-
use_container_width=True
|
463 |
-
)
|
|
|
427 |
overall_sim_df = pd.DataFrame(overall_sim_results)
|
428 |
overall_sim_df = overall_sim_df.drop_duplicates(subset = ['Player', 'Stat'])
|
429 |
|
430 |
+
tab1, tab2, tab3 = st.tabs(["Overall Data", "Individual Game Data", "Opponent Data"])
|
431 |
with tab1:
|
432 |
st.subheader("Full Match Data")
|
433 |
st.dataframe(player_summary.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(display_formats, precision=2), use_container_width = True)
|
434 |
+
|
435 |
+
st.subheader("Overall Simulations")
|
436 |
+
stat_tabs = st.tabs(["Kills", "Deaths", "Assists", "CS"])
|
437 |
+
|
438 |
+
for stat, tab in zip(["Kills", "Deaths", "Assists", "CS"], stat_tabs):
|
439 |
+
with tab:
|
440 |
+
stat_data = overall_sim_df[overall_sim_df['Stat'] == stat].copy()
|
441 |
+
stat_data = stat_data.set_index('Player')[['Position', '10%', '25%', '50%', '75%', '90%']]
|
442 |
+
st.dataframe(
|
443 |
+
stat_data.style.format(precision=2).background_gradient(axis=0).background_gradient(cmap='RdYlGn'),
|
444 |
+
use_container_width=True
|
445 |
+
)
|
446 |
+
|
447 |
+
with tab2:
|
448 |
st.subheader("Individual Game Data")
|
449 |
st.dataframe(team_data.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(display_formats, precision=2), use_container_width = True)
|
|
|
|
|
450 |
|
451 |
+
st.subheader("Individual Game Simulations")
|
452 |
+
unique_players = sim_df['Player'].unique().tolist()
|
453 |
+
player_tabs = st.tabs(unique_players)
|
454 |
+
|
455 |
+
for player, tab in zip(unique_players, player_tabs):
|
456 |
+
with tab:
|
457 |
+
player_data = sim_df[sim_df['Player'] == player]
|
458 |
+
player_data = player_data.set_index('Stat')
|
459 |
+
st.dataframe(
|
460 |
+
player_data[['10%', '25%', '50%', '75%', '90%']]
|
461 |
+
.style.format(precision=2),
|
462 |
+
use_container_width=True
|
463 |
+
)
|
464 |
+
|
465 |
+
with tab3:
|
466 |
+
st.dataframe(opp_boost.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|