James McCool commited on
Commit
3626a1a
·
1 Parent(s): 7e14434

Update Handbuilder tab in app.py to replace empty string values with NaN for 'Order', 'Salary', 'Median', and 'Own%' columns in the lineup DataFrame. Adjust background gradient logic for improved visual representation of player data, enhancing clarity and user experience.

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -923,19 +923,19 @@ with tab4:
923
  display_rows.append({
924
  'Slot': slot,
925
  'Player': '',
926
- 'Order': '',
927
  'Position': '',
928
  'Team': '',
929
- 'Salary': '',
930
- 'Median': '',
931
- 'Own%': ''
932
  })
933
 
934
  lineup_display_df = pd.DataFrame(display_rows, columns=display_columns)
935
 
936
  # Show the lineup table with single-row selection for removal
937
  event_remove = st.dataframe(
938
- lineup_display_df.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').background_gradient(cmap='RdYlGn_r', subset=['Order', 'Salary', 'Own%']).format(precision=2),
939
  on_select="rerun",
940
  selection_mode=["single-row"],
941
  key="lineup_remove",
 
923
  display_rows.append({
924
  'Slot': slot,
925
  'Player': '',
926
+ 'Order': np.nan,
927
  'Position': '',
928
  'Team': '',
929
+ 'Salary': np.nan,
930
+ 'Median': np.nan,
931
+ 'Own%': np.nan
932
  })
933
 
934
  lineup_display_df = pd.DataFrame(display_rows, columns=display_columns)
935
 
936
  # Show the lineup table with single-row selection for removal
937
  event_remove = st.dataframe(
938
+ lineup_display_df.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn', subset=['Median']).background_gradient(cmap='RdYlGn_r', subset=['Order', 'Salary', 'Own%']).format(precision=2),
939
  on_select="rerun",
940
  selection_mode=["single-row"],
941
  key="lineup_remove",