Spaces:
Sleeping
Sleeping
Commit ·
c110b2c
1
Parent(s): eaf5fcb
Replace group prediction cards with a per-game table + group/date filters
Browse files
app.py
CHANGED
|
@@ -500,6 +500,24 @@ def render_predictions() -> None:
|
|
| 500 |
"Once a game is played, ✅ / ❌ shows whether the pick was correct."
|
| 501 |
)
|
| 502 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 503 |
model_labels = [meta["label"] for meta in MODEL_META.values()]
|
| 504 |
column_config = {
|
| 505 |
"Group": st.column_config.TextColumn("Group", width="small"),
|
|
|
|
| 500 |
"Once a game is played, ✅ / ❌ shows whether the pick was correct."
|
| 501 |
)
|
| 502 |
|
| 503 |
+
# Filters: group and date (empty selection = show all)
|
| 504 |
+
col_g, col_d = st.columns(2)
|
| 505 |
+
with col_g:
|
| 506 |
+
group_opts = sorted(g for g in df["Group"].unique() if g and g != "—")
|
| 507 |
+
sel_groups = st.multiselect("Filter by group", options=group_opts, default=[])
|
| 508 |
+
with col_d:
|
| 509 |
+
date_opts = sorted(d for d in df["Date"].unique() if d)
|
| 510 |
+
sel_dates = st.multiselect("Filter by date", options=date_opts, default=[])
|
| 511 |
+
|
| 512 |
+
if sel_groups:
|
| 513 |
+
df = df[df["Group"].isin(sel_groups)]
|
| 514 |
+
if sel_dates:
|
| 515 |
+
df = df[df["Date"].isin(sel_dates)]
|
| 516 |
+
|
| 517 |
+
if df.empty:
|
| 518 |
+
st.info("No matches for the selected filters.")
|
| 519 |
+
return
|
| 520 |
+
|
| 521 |
model_labels = [meta["label"] for meta in MODEL_META.values()]
|
| 522 |
column_config = {
|
| 523 |
"Group": st.column_config.TextColumn("Group", width="small"),
|