James McCool commited on
Commit
cd69a95
·
1 Parent(s): 45307d2

Refactor init_team_data function in app.py to improve data handling and output format. Removed unnecessary display of opponent performance metrics and changed the return format to set the playername as the index. This update enhances the clarity of the returned data structure while maintaining the integrity of team performance evaluations.

Browse files
Files changed (1) hide show
  1. app.py +1 -6
app.py CHANGED
@@ -283,13 +283,8 @@ def init_team_data(team, opponent, win_loss, kill_prediction, death_prediction,
283
  team_data['Assist_Proj'] = team_data.apply(lambda row: row['lAssist%'] * opp_pos_assists_boost_loss.get(row['position'], 1), axis=1)
284
  team_data['CS_Proj'] = team_data.apply(lambda row: row['lCS'] * opp_pos_cs_boost_loss.get(row['position'], 1), axis=1)
285
  team_data = team_data[['playername', 'teamname', 'position', 'Kill_Proj', 'Death_Proj', 'Assist_Proj', 'CS_Proj']]
286
-
287
- st.write(opp_pos_kills_boost_win)
288
- st.write(opp_pos_deaths_boost_win)
289
- st.write(opp_pos_assists_boost_win)
290
- st.write(opp_pos_cs_boost_win)
291
 
292
- return team_data.dropna().reset_index(drop=True)
293
 
294
  if st.button("Run"):
295
  st.dataframe(init_team_data(selected_team, selected_opponent, win_loss, kill_prediction, death_prediction, start_date, end_date).style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(display_formats, precision=2), use_container_width = True)
 
283
  team_data['Assist_Proj'] = team_data.apply(lambda row: row['lAssist%'] * opp_pos_assists_boost_loss.get(row['position'], 1), axis=1)
284
  team_data['CS_Proj'] = team_data.apply(lambda row: row['lCS'] * opp_pos_cs_boost_loss.get(row['position'], 1), axis=1)
285
  team_data = team_data[['playername', 'teamname', 'position', 'Kill_Proj', 'Death_Proj', 'Assist_Proj', 'CS_Proj']]
 
 
 
 
 
286
 
287
+ return team_data.dropna().set_index('playername')
288
 
289
  if st.button("Run"):
290
  st.dataframe(init_team_data(selected_team, selected_opponent, win_loss, kill_prediction, death_prediction, start_date, end_date).style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(display_formats, precision=2), use_container_width = True)