Spaces:
Running
Running
James McCool
commited on
Commit
·
0e59510
1
Parent(s):
2536839
Refactor init_team_data function in app.py to streamline team data output. Added filtering to include only relevant columns and implemented dropna() and reset_index() for cleaner dataframe presentation.
Browse files
app.py
CHANGED
@@ -66,11 +66,13 @@ def init_team_data(team, win_loss, kill_prediction, death_prediction):
|
|
66 |
if win_loss == "Win":
|
67 |
team_data['Kill_Proj'] = team_data['wKill%'] * kill_prediction
|
68 |
team_data['Death_Proj'] = team_data['wDeath%'] * death_prediction
|
|
|
69 |
else:
|
70 |
team_data['Kill_Proj'] = team_data['lKill%'] * kill_prediction
|
71 |
team_data['Death_Proj'] = team_data['lDeath%'] * death_prediction
|
|
|
72 |
|
73 |
-
return team_data
|
74 |
|
75 |
if st.button("Run"):
|
76 |
st.dataframe(init_team_data(selected_team, win_loss, kill_prediction, death_prediction).style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(display_formats, precision=2), use_container_width = True)
|
|
|
66 |
if win_loss == "Win":
|
67 |
team_data['Kill_Proj'] = team_data['wKill%'] * kill_prediction
|
68 |
team_data['Death_Proj'] = team_data['wDeath%'] * death_prediction
|
69 |
+
team_data = team_data[['playername', 'teamname', 'wKill%', 'wDeath%', 'wAssist%', 'wCS', 'Kill_Proj', 'Death_Proj']]
|
70 |
else:
|
71 |
team_data['Kill_Proj'] = team_data['lKill%'] * kill_prediction
|
72 |
team_data['Death_Proj'] = team_data['lDeath%'] * death_prediction
|
73 |
+
team_data = team_data[['playername', 'teamname', 'lKill%', 'lDeath%', 'lAssist%', 'lCS', 'Kill_Proj', 'Death_Proj']]
|
74 |
|
75 |
+
return team_data.dropna().reset_index(drop=True)
|
76 |
|
77 |
if st.button("Run"):
|
78 |
st.dataframe(init_team_data(selected_team, win_loss, kill_prediction, death_prediction).style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(display_formats, precision=2), use_container_width = True)
|