Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -213,11 +213,15 @@ if fetch_data:
|
|
213 |
|
214 |
metadata_df = pd.DataFrame(items)
|
215 |
|
|
|
|
|
|
|
|
|
216 |
# New way to calculate incomplete record mask
|
217 |
incomplete_mask = metadata_df.apply(lambda row: row.map(is_incomplete), axis=1).any(axis=1)
|
218 |
incomplete_count = incomplete_mask.sum()
|
219 |
|
220 |
-
# Display
|
221 |
if not metadata_df.empty:
|
222 |
stats_html = f"""
|
223 |
<div class="sidebar-stats">
|
@@ -229,6 +233,7 @@ if fetch_data:
|
|
229 |
stats_placeholder.markdown(stats_html, unsafe_allow_html=True)
|
230 |
|
231 |
|
|
|
232 |
# Utility functions for deeper metadata quality analysis
|
233 |
def is_incomplete(value):
|
234 |
return pd.isna(value) or value in ["", "N/A", "null", None]
|
|
|
213 |
|
214 |
metadata_df = pd.DataFrame(items)
|
215 |
|
216 |
+
# Define custom completeness check
|
217 |
+
def is_incomplete(value):
|
218 |
+
return pd.isna(value) or value in ["", "N/A", "null", None]
|
219 |
+
|
220 |
# New way to calculate incomplete record mask
|
221 |
incomplete_mask = metadata_df.apply(lambda row: row.map(is_incomplete), axis=1).any(axis=1)
|
222 |
incomplete_count = incomplete_mask.sum()
|
223 |
|
224 |
+
# Display Quick Stats right after dropdown
|
225 |
if not metadata_df.empty:
|
226 |
stats_html = f"""
|
227 |
<div class="sidebar-stats">
|
|
|
233 |
stats_placeholder.markdown(stats_html, unsafe_allow_html=True)
|
234 |
|
235 |
|
236 |
+
|
237 |
# Utility functions for deeper metadata quality analysis
|
238 |
def is_incomplete(value):
|
239 |
return pd.isna(value) or value in ["", "N/A", "null", None]
|