Jan Mühlnikel
commited on
Commit
·
c7e24a4
1
Parent(s):
6f89058
error fixing
Browse files
modules/singlematch_result_table.py
CHANGED
|
@@ -4,25 +4,25 @@ import pandas as pd
|
|
| 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(";")[:-
|
| 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(";")[:-
|
| 11 |
)
|
| 12 |
result_df['sdg_list'] = result_df['sgd_pred_code'].apply(
|
| 13 |
-
lambda x: [""] if x is None 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(";")[:-
|
| 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(";")[:-
|
| 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(";")[:-
|
| 26 |
)
|
| 27 |
|
| 28 |
st.dataframe(
|
|
|
|
| 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(";")[:-1])
|
| 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(";")[:-1])
|
| 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(";")[:-1])
|
| 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(";")[:-1])
|
| 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(
|