Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,20 +87,28 @@ def render_results_md(df, show_score=True):
|
|
| 87 |
|
| 88 |
def render_best_md(df):
|
| 89 |
if df is None or df.empty:
|
| 90 |
-
return "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
r = df.iloc[0]
|
| 93 |
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
|
| 106 |
|
|
|
|
| 87 |
|
| 88 |
def render_best_md(df):
|
| 89 |
if df is None or df.empty:
|
| 90 |
+
return "❌ No confident best match found."
|
| 91 |
+
|
| 92 |
+
headers = ["School Name", "UDISE Code", "State", "District", "Block", "Score"]
|
| 93 |
+
|
| 94 |
+
md = "| " + " | ".join(headers) + " |\n"
|
| 95 |
+
md += "| " + " | ".join(["---"] * len(headers)) + " |\n"
|
| 96 |
|
| 97 |
r = df.iloc[0]
|
| 98 |
|
| 99 |
+
row = [
|
| 100 |
+
str(r.get("School_Name", "")),
|
| 101 |
+
str(r.get("UDISE_Code", "")),
|
| 102 |
+
str(r.get("State", "")),
|
| 103 |
+
str(r.get("District", "")),
|
| 104 |
+
str(r.get("Block", "")),
|
| 105 |
+
f"{float(r.get('Score', 0)):.2f}",
|
| 106 |
+
]
|
| 107 |
+
|
| 108 |
+
md += "| " + " | ".join(row) + " |\n"
|
| 109 |
+
|
| 110 |
+
return md
|
| 111 |
+
|
| 112 |
|
| 113 |
|
| 114 |
|