James McCool commited on
Commit
7984d0e
·
1 Parent(s): b36408f

Update duplication metrics in app.py to include average duplicates

Browse files

- Modified the duplication frame to replace 'dupes' with 'EntryCount' for better clarity in metrics.
- Added a new column 'average_dupes' to calculate the mean of duplicates per BaseName, enhancing data analysis capabilities.
- Adjusted the background gradient color scheme for improved visual representation of the data.

Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -424,5 +424,7 @@ with tab2:
424
  st.dataframe(st.session_state['general_frame'].style.background_gradient(cmap='RdYlGn', axis=1).format(precision=2), hide_index=True)
425
 
426
  with tab5:
427
- st.session_state['duplication_frame'] = working_df[['BaseName', 'dupes', 'uniques', 'under_5', 'under_10']].drop_duplicates(subset='BaseName', keep='first')
428
- st.dataframe(st.session_state['duplication_frame'].style.background_gradient(cmap='RdYlGn', axis=1).format(precision=2), hide_index=True)
 
 
 
424
  st.dataframe(st.session_state['general_frame'].style.background_gradient(cmap='RdYlGn', axis=1).format(precision=2), hide_index=True)
425
 
426
  with tab5:
427
+ st.session_state['duplication_frame'] = working_df[['BaseName', 'EntryCount', 'uniques', 'under_5', 'under_10']]
428
+ st.session_state['duplication_frame']['average_dupes'] = st.session_state['duplication_frame'].groupby('BaseName')['dupes'].mean()
429
+ st.session_state['duplication_frame'] = st.session_state['duplication_frame'].drop_duplicates(subset='BaseName', keep='first')
430
+ st.dataframe(st.session_state['duplication_frame'].style.background_gradient(cmap='RdYlGn_r', axis=1).format(precision=2), hide_index=True)