From 368b78c80032fa2de09fe63616ab34a29ccd2fb9 Mon Sep 17 00:00:00 2001 From: Ronan Date: Sun, 5 May 2024 21:16:58 +0200 Subject: [PATCH] small fixes --- app/pages/2_Metadata.py | 4 +++- app/pages/5_Clean_Tables.py | 2 +- country_by_country/utils/utils.py | 7 ------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/app/pages/2_Metadata.py b/app/pages/2_Metadata.py index 2445f4f..e1ce0a4 100644 --- a/app/pages/2_Metadata.py +++ b/app/pages/2_Metadata.py @@ -73,7 +73,9 @@ currency = st.selectbox( "Currency", currencies, - index=currencies.index(currency) if currency else 0, + index=currencies.index(currency) + if currency + else currencies.index("EUR - Euro"), ) units = [ diff --git a/app/pages/5_Clean_Tables.py b/app/pages/5_Clean_Tables.py index 45b3a15..97e1338 100644 --- a/app/pages/5_Clean_Tables.py +++ b/app/pages/5_Clean_Tables.py @@ -172,7 +172,7 @@ def update_df_csv_to_save() -> None: ), ) - st.data_editor( + st.session_state.tables[st.session_state["algorithm_name"]] = st.data_editor( st.session_state.tables[st.session_state["algorithm_name"]], num_rows="dynamic", on_change=update_df_csv_to_save, diff --git a/country_by_country/utils/utils.py b/country_by_country/utils/utils.py index dd09e8d..93ecc4c 100644 --- a/country_by_country/utils/utils.py +++ b/country_by_country/utils/utils.py @@ -72,13 +72,6 @@ def gather_tables( "No Extract " + str(i + 1) for i in range(tables[i].shape[1]) ] break - for label, content in tables[i].items(): - if ( - content.dtype == "object" - ): # Check if the column contains string data - tables[i][label] = tables[i][label].replace("", None) - tables[i][label] = tables[i][label].str.replace(".", "") - tables[i][label] = tables[i][label].str.replace(",", ".") tables_by_name[asset["type"] + "_" + str(i)] = tables[i] return tables_by_name