Jan Mühlnikel
commited on
Commit
·
14b1a2a
1
Parent(s):
de39c9b
added selected project df
Browse files
modules/singlematch_result_table.py
CHANGED
@@ -4,23 +4,25 @@ import pandas as pd
|
|
4 |
def show_single_table(selected_project_index, projects_df, result_df):
|
5 |
|
6 |
st.write("------------------")
|
7 |
-
|
|
|
|
|
|
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
13 |
|
14 |
-
# Create a new DataFrame for the transformed Series for a vertical display
|
15 |
-
display_df = pd.DataFrame({
|
16 |
-
'Field': project_series.index,
|
17 |
-
'Value': project_series.values
|
18 |
-
})
|
19 |
|
20 |
st.dataframe(
|
21 |
-
|
22 |
use_container_width = True,
|
23 |
-
height = 35 + 35 * len(
|
24 |
column_config={
|
25 |
"iati_id": st.column_config.TextColumn(
|
26 |
"IATI ID",
|
|
|
4 |
def show_single_table(selected_project_index, projects_df, result_df):
|
5 |
|
6 |
st.write("------------------")
|
7 |
+
try:
|
8 |
+
projects_df["crs_3_code_list"] = [projects_df['crs_3_code'].item().split(";")[:-1]]
|
9 |
+
except:
|
10 |
+
projects_df["crs_3_code_list"] = [""]
|
11 |
|
12 |
+
try:
|
13 |
+
projects_df["crs_5_code_list"] = [projects_df['crs_5_code'].item().split(";")[:-1]]
|
14 |
+
except:
|
15 |
+
projects_df["crs_5_code_list"] = [""]
|
16 |
+
|
17 |
+
projects_df["sdg_list"] = [projects_df['sgd_pred_code'].item()]
|
18 |
+
|
19 |
+
sel_p_row = projects_df.iloc[selected_project_index].T
|
20 |
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
st.dataframe(
|
23 |
+
sel_p_row[["iati_id", "title_main", "orga_abbreviation", "client", "description_main", "country_name", "country_flag", "sdg_list", "crs_3_code_list", "crs_5_code_list"]],
|
24 |
use_container_width = True,
|
25 |
+
height = 35 + 35 * len(sel_p_row),
|
26 |
column_config={
|
27 |
"iati_id": st.column_config.TextColumn(
|
28 |
"IATI ID",
|