2nzi commited on
Commit
d2bdda3
·
verified ·
1 Parent(s): 7fed0d3

update palyer analysis

Browse files
streamlit_app/components/player_analysis.py CHANGED
@@ -302,7 +302,11 @@ def show_player_analysis(df):
302
 
303
 
304
  with col_avg_per_match:
305
- match_note = player_scores_filtered[player_scores_filtered['Match'] == selected_match]['note_match_joueuse'].mean().round(1)
 
 
 
 
306
  circular_kpi(
307
  value=match_note,
308
  label="Note du match",
@@ -382,7 +386,7 @@ def show_player_analysis(df):
382
  action_stats = {
383
  'min': float(player_action_stats['Nb_actions'].min()) if len(player_action_stats) > 0 else 0,
384
  'max': float(player_action_stats['Nb_actions'].max()) if len(player_action_stats) > 0 else 0,
385
- 'mean': float(player_action_stats['Nb_actions'].mean().round(1)) if len(player_action_stats) > 0 else 0
386
  }
387
 
388
 
 
302
 
303
 
304
  with col_avg_per_match:
305
+ match_note = player_scores_filtered[player_scores_filtered['Match'] == selected_match]['note_match_joueuse'].mean()
306
+ if pd.notna(match_note):
307
+ match_note = round(match_note, 1)
308
+ else:
309
+ match_note = 0.0
310
  circular_kpi(
311
  value=match_note,
312
  label="Note du match",
 
386
  action_stats = {
387
  'min': float(player_action_stats['Nb_actions'].min()) if len(player_action_stats) > 0 else 0,
388
  'max': float(player_action_stats['Nb_actions'].max()) if len(player_action_stats) > 0 else 0,
389
+ 'mean': float(round(player_action_stats['Nb_actions'].mean(), 1)) if len(player_action_stats) > 0 else 0
390
  }
391
 
392