Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -241,25 +241,19 @@ if fetch_data:
|
|
241 |
completeness_table = completeness_df.set_index("Field")
|
242 |
|
243 |
# Sidebar Quick Stats
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
<b>Overall Completeness:</b> {overall_percent:.1f}%
|
257 |
-
</div>
|
258 |
-
</div>
|
259 |
-
"""
|
260 |
-
stats_placeholder.markdown(stats_html, unsafe_allow_html=True)
|
261 |
|
262 |
-
stats_placeholder.markdown(stats_html, unsafe_allow_html=True)
|
263 |
|
264 |
# Calculate Top 10 Subjects
|
265 |
if 'subject' in metadata_df.columns:
|
|
|
241 |
completeness_table = completeness_df.set_index("Field")
|
242 |
|
243 |
# Sidebar Quick Stats
|
244 |
+
# π Sidebar Quick Stats (new professional table version)
|
245 |
+
quick_stats_df = pd.DataFrame({
|
246 |
+
"Metric": ["Total Records", "Incomplete Records", "Overall Completeness (%)"],
|
247 |
+
"Value": [len(metadata_df), incomplete_count, round(overall_percent, 1)]
|
248 |
+
})
|
249 |
+
|
250 |
+
with st.sidebar.expander("Quick Stats", expanded=True):
|
251 |
+
st.dataframe(
|
252 |
+
quick_stats_df.style.background_gradient(cmap="Oranges", subset=["Value"]).format({"Value": "{:.1f}"}),
|
253 |
+
use_container_width=True,
|
254 |
+
height=240
|
255 |
+
)
|
|
|
|
|
|
|
|
|
|
|
256 |
|
|
|
257 |
|
258 |
# Calculate Top 10 Subjects
|
259 |
if 'subject' in metadata_df.columns:
|