You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Introduced a checkbox to toggle the visibility of all columns in the data table.
- Defined a mapping for default column names to improve readability.
- Updated the data display logic to conditionally show either all columns or a subset with renamed headers based on user selection.
Copy file name to clipboardExpand all lines: main.py
+20-2Lines changed: 20 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,17 @@ def main():
26
26
st.caption("Dati del 2024")
27
27
28
28
29
+
show_all_columns=st.checkbox("Mostra tutte le colonne", value=False)
30
+
31
+
default_columns= {
32
+
"Comune_descrizione" : "Comune",
33
+
"Descr_Tipologia" : "Tipologia",
34
+
"Zona_Descr" : "Zona",
35
+
"Compr_min" : "Prezzo acquisto minimo al mq (€)",
36
+
"Compr_max" : "Prezzo acquisto massimo al mq (€)",
37
+
"Loc_min" : "Prezzo locazione minimo al mq (€)",
38
+
"Loc_max" : "Prezzo locazione massimo al mq (€)"
39
+
}
29
40
30
41
regioni_dataset=get_regioni(conn)["Regione"]
31
42
selected_regione=st.sidebar.selectbox("Seleziona la regione", regioni_dataset)
@@ -40,8 +51,15 @@ def main():
40
51
41
52
if(selected_tipologia!=None):
42
53
result=conn.execute(f"SELECT * FROM joined_data WHERE Regione = '{selected_regione}' and Comune_descrizione = '{selected_comune}' and Descr_Tipologia = '{selected_tipologia}'").df()
0 commit comments