CCockrum commited on
Commit
d0a2375
·
verified ·
1 Parent(s): 8e72b5f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -239,24 +239,26 @@ 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 (index hidden, orange theme)
243
  quick_stats = pd.DataFrame({
244
  "Metric": ["Total Records", "Incomplete Records", "Overall Completeness (%)"],
245
  "Value": [len(metadata_df), incomplete_count, round(overall_percent, 1)]
246
  })
247
- # Style it without index
 
248
  styled_quick_stats = (
249
  quick_stats.style
250
- .hide(axis="index") # This works for regular pandas display but not enough for Streamlit
251
  .background_gradient(cmap="Oranges", subset=["Value"])
252
  .format({"Value": "{:.1f}"})
253
  )
254
- # Use dataframe with hide_index parameter
 
255
  st.sidebar.dataframe(
256
  styled_quick_stats,
257
  use_container_width=True,
258
  height=240,
259
- hide_index=True # This is the key parameter for Streamlit
260
  )
261
 
262
  # Calculate Top 10 Subjects
 
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 = pd.DataFrame({
244
  "Metric": ["Total Records", "Incomplete Records", "Overall Completeness (%)"],
245
  "Value": [len(metadata_df), incomplete_count, round(overall_percent, 1)]
246
  })
247
+
248
+ # Style it without index - similar to your top subjects table
249
  styled_quick_stats = (
250
  quick_stats.style
251
+ .hide(axis="index")
252
  .background_gradient(cmap="Oranges", subset=["Value"])
253
  .format({"Value": "{:.1f}"})
254
  )
255
+
256
+ # Use dataframe with hide_index parameter like in your top subjects example
257
  st.sidebar.dataframe(
258
  styled_quick_stats,
259
  use_container_width=True,
260
  height=240,
261
+ hide_index=True
262
  )
263
 
264
  # Calculate Top 10 Subjects