Jan Mühlnikel
commited on
Commit
·
10d3373
1
Parent(s):
4e1bb49
error fixing
Browse files
modules/singlematch_result_table.py
CHANGED
@@ -3,15 +3,27 @@ import pandas as pd
|
|
3 |
|
4 |
def show_single_table(selected_project_index, projects_df, result_df):
|
5 |
|
6 |
-
result_df['crs_3_code_list'] = result_df['crs_3_code'].apply(
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
sel_p_row = projects_df.iloc[[selected_project_index]]
|
11 |
|
12 |
-
sel_p_row['crs_3_code_list'] = sel_p_row['crs_3_code'].apply(
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
st.dataframe(
|
17 |
sel_p_row[["iati_id", "title_main", "orga_abbreviation", "client", "description_main", "country_name", "country_flag", "crs_3_code_list", "crs_5_code_list", "sdg_list"]],
|
|
|
3 |
|
4 |
def show_single_table(selected_project_index, projects_df, result_df):
|
5 |
|
6 |
+
result_df['crs_3_code_list'] = result_df['crs_3_code'].apply(
|
7 |
+
lambda x: [""] if x is None else (str(x).split(";")[:-1] if str(x).endswith(";") else str(x).split(";"))
|
8 |
+
)
|
9 |
+
result_df['crs_5_code_list'] = result_df['crs_5_code'].apply(
|
10 |
+
lambda x: [""] if x is None else (str(x).split(";")[:-1] if str(x).endswith(";") else str(x).split(";"))
|
11 |
+
)
|
12 |
+
result_df['sdg_list'] = result_df['sgd_pred_code'].apply(
|
13 |
+
lambda x: [""] if x is None else (str(x).split(";")[:-1] if str(x).endswith(";") else str(x).split(";"))
|
14 |
+
)
|
15 |
|
16 |
sel_p_row = projects_df.iloc[[selected_project_index]]
|
17 |
|
18 |
+
sel_p_row['crs_3_code_list'] = sel_p_row['crs_3_code'].apply(
|
19 |
+
lambda x: [""] if x is None else (str(x).split(";")[:-1] if str(x).endswith(";") else str(x).split(";"))
|
20 |
+
)
|
21 |
+
sel_p_row['crs_5_code_list'] = sel_p_row['crs_5_code'].apply(
|
22 |
+
lambda x: [""] if x is None else (str(x).split(";")[:-1] if str(x).endswith(";") else str(x).split(";"))
|
23 |
+
)
|
24 |
+
sel_p_row['sdg_list'] = sel_p_row['sgd_pred_code'].apply(
|
25 |
+
lambda x: [""] if x is None else (str(x).split(";")[:-1] if str(x).endswith(";") else str(x).split(";"))
|
26 |
+
)
|
27 |
|
28 |
st.dataframe(
|
29 |
sel_p_row[["iati_id", "title_main", "orga_abbreviation", "client", "description_main", "country_name", "country_flag", "crs_3_code_list", "crs_5_code_list", "sdg_list"]],
|