CCockrum commited on
Commit
1534249
·
verified ·
1 Parent(s): 58fb3b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -12
app.py CHANGED
@@ -239,13 +239,12 @@ if fetch_data:
239
  completeness_df = pd.DataFrame({"Field": completeness.index, "Completeness (%)": completeness.values})
240
  completeness_table = completeness_df.set_index("Field")
241
 
242
- # Sidebar Quick Stats (fancy card version)
243
  quick_stats_df = pd.DataFrame({
244
  "Metric": ["Total Records", "Incomplete Records", "Overall Completeness (%)"],
245
  "Value": [len(metadata_df), incomplete_count, round(overall_percent, 1)]
246
  })
247
 
248
- # Card-like background container
249
  st.sidebar.markdown("""
250
  <div style='
251
  background-color: #2b2b2b;
@@ -254,19 +253,13 @@ if fetch_data:
254
  margin-bottom: 1.5rem;
255
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
256
  '>
257
- <h4 style='color: #FFA500; margin-bottom: 1rem;'>Quick Stats</h4>
258
  </div>
259
  """, unsafe_allow_html=True)
260
 
261
- # Now display the styled dataframe
262
- st.sidebar.dataframe(
263
- quick_stats_df.style
264
- .background_gradient(cmap="Oranges", subset=["Value"])
265
- .format({"Value": "{:.1f}"}),
266
- use_container_width=True,
267
- height=240,
268
- hide_index=True #<<--- add THIS here to hide 0,1,2
269
- )
270
 
271
  # Calculate Top 10 Subjects
272
  if 'subject' in metadata_df.columns:
 
239
  completeness_df = pd.DataFrame({"Field": completeness.index, "Completeness (%)": completeness.values})
240
  completeness_table = completeness_df.set_index("Field")
241
 
242
+ # Sidebar Quick Stats
243
  quick_stats_df = pd.DataFrame({
244
  "Metric": ["Total Records", "Incomplete Records", "Overall Completeness (%)"],
245
  "Value": [len(metadata_df), incomplete_count, round(overall_percent, 1)]
246
  })
247
 
 
248
  st.sidebar.markdown("""
249
  <div style='
250
  background-color: #2b2b2b;
 
253
  margin-bottom: 1.5rem;
254
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
255
  '>
256
+ <h4 style='color: #FFA500; margin-bottom: 1rem;'>📊 Quick Stats</h4>
257
  </div>
258
  """, unsafe_allow_html=True)
259
 
260
+ styled_stats = quick_stats_df.style.background_gradient(cmap="Oranges", subset=["Value"]).format({"Value": "{:.1f}"})
261
+ st.sidebar.table(styled_stats)
262
+
 
 
 
 
 
 
263
 
264
  # Calculate Top 10 Subjects
265
  if 'subject' in metadata_df.columns: