James McCool commited on
Commit
02107a7
·
1 Parent(s): 6864f0f

Enhance general exposures dataframe in create_general_exposures function

Browse files

- Updated the replacement of specific column names in the general exposures dataframe for improved clarity and consistency in presentation.
- Ensured the dataframe maintains its existing functionality while refining the output for better user understanding.

app.py CHANGED
@@ -293,15 +293,13 @@ with tab2:
293
  if entry_parse_var == 'All':
294
  st.session_state['general_frame'] = create_general_exposures(working_df)
295
  st.dataframe(st.session_state['general_frame'].
296
- style.background_gradient(axis=1).
297
- background_gradient(cmap='RdYlGn').
298
  format(precision=2),
299
  hide_index=True)
300
  else:
301
  st.session_state['general_frame'] = create_general_exposures(working_df, entry_names)
302
  st.dataframe(st.session_state['general_frame'].
303
- style.background_gradient(axis=1).
304
- background_gradient(cmap='RdYlGn').
305
  format(precision=2),
306
  hide_index=True)
307
 
 
293
  if entry_parse_var == 'All':
294
  st.session_state['general_frame'] = create_general_exposures(working_df)
295
  st.dataframe(st.session_state['general_frame'].
296
+ style.background_gradient(cmap='RdYlGn', axis=1).
 
297
  format(precision=2),
298
  hide_index=True)
299
  else:
300
  st.session_state['general_frame'] = create_general_exposures(working_df, entry_names)
301
  st.dataframe(st.session_state['general_frame'].
302
+ style.background_gradient(cmap='RdYlGn', axis=1).
 
303
  format(precision=2),
304
  hide_index=True)
305
 
global_func/create_general_exposures.py CHANGED
@@ -36,5 +36,5 @@ def create_general_exposures(df: pd.DataFrame, entrants: list = None):
36
  general_exposures = general_row
37
  else:
38
  general_exposures = pd.concat([general_exposures, general_frame], ignore_index = True, axis = 0)
39
-
40
  return general_exposures
 
36
  general_exposures = general_row
37
  else:
38
  general_exposures = pd.concat([general_exposures, general_frame], ignore_index = True, axis = 0)
39
+ general_exposures = general_exposures.replace(['salary', 'actual_fpts', 'actual_own', 'dupes'], ['Salary Used', 'Finishing Points', 'Total Ownership', 'Duplications'])
40
  return general_exposures