CCockrum commited on
Commit
f75b2e1
·
verified ·
1 Parent(s): 6125674

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -4
app.py CHANGED
@@ -239,7 +239,7 @@ 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)]
@@ -254,14 +254,27 @@ 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
  quick_stats_df_reset = quick_stats_df.reset_index(drop=True)
262
 
263
- styled_stats = quick_stats_df_reset.style.background_gradient(cmap="Oranges", subset=["Value"]).format({"Value": "{:.1f}"})
264
- st.sidebar.table(styled_stats)
 
 
 
 
 
 
 
 
 
 
 
 
265
 
266
 
267
  # 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_df = pd.DataFrame({
244
  "Metric": ["Total Records", "Incomplete Records", "Overall Completeness (%)"],
245
  "Value": [len(metadata_df), incomplete_count, round(overall_percent, 1)]
 
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
+ # Reset index to hide row numbers
262
  quick_stats_df_reset = quick_stats_df.reset_index(drop=True)
263
 
264
+ # Style with orange gradient
265
+ styled_stats = (
266
+ quick_stats_df_reset.style
267
+ .background_gradient(cmap="Oranges", subset=["Value"])
268
+ .format({"Value": "{:.1f}"})
269
+ )
270
+
271
+ # Display styled dataframe without index
272
+ st.sidebar.dataframe(
273
+ styled_stats,
274
+ use_container_width=True,
275
+ height=240
276
+ )
277
+
278
 
279
 
280
  # Calculate Top 10 Subjects