faizhalas commited on
Commit
00fb7ba
·
verified ·
1 Parent(s): a14eddb

Update Home.py

Browse files
Files changed (1) hide show
  1. Home.py +11 -16
Home.py CHANGED
@@ -52,19 +52,7 @@ search_opt = c2.multiselect(
52
  part_opt,
53
  ["Title", "Abstract (en)", "Keywords"])
54
 
55
-
56
-
57
- #tab1, tab2 = st.tabs(["🔍 Hasil Pencarian", "📊 Analisis Hasil"])
58
-
59
-
60
  try:
61
- #key_df_j = pd.DataFrame()
62
- #patterns = [r'\b{}\b'.format(re.escape(word)) for word in keyword_list_j]
63
-
64
- #for col in search_opt:
65
- #conditions = [df[col].str.contains(pattern, regex=True, flags=re.IGNORECASE) for pattern in patterns]
66
- #column_result = df[np.logical_and.reduce(conditions)]
67
- #key_df_j = pd.concat([key_df_j, column_result]).drop_duplicates()
68
  @st.cache_data
69
  def search_data(text_search, search_opt):
70
  key_df_j = df
@@ -76,7 +64,6 @@ try:
76
  return res_df
77
 
78
  key_df_j = search_data(text_search, search_opt)
79
- st.write(key_df_j)
80
 
81
  # creating result
82
  if text_search:
@@ -87,9 +74,17 @@ try:
87
 
88
  selection = cl1.radio("Pilih menu", ("Hasil Pencarian", "Analisis Hasil"), horizontal=True)
89
 
90
- popover = cl2.popover("Unduh Hasil Pencarian")
91
- red = popover.checkbox("Show red items.", True)
92
- blue = popover.checkbox("Show blue items.", True)
 
 
 
 
 
 
 
 
93
 
94
  @st.cache_data
95
  def get_data(df):
 
52
  part_opt,
53
  ["Title", "Abstract (en)", "Keywords"])
54
 
 
 
 
 
 
55
  try:
 
 
 
 
 
 
 
56
  @st.cache_data
57
  def search_data(text_search, search_opt):
58
  key_df_j = df
 
64
  return res_df
65
 
66
  key_df_j = search_data(text_search, search_opt)
 
67
 
68
  # creating result
69
  if text_search:
 
74
 
75
  selection = cl1.radio("Pilih menu", ("Hasil Pencarian", "Analisis Hasil"), horizontal=True)
76
 
77
+ with cl2.popover("Unduh Hasil Pencarian"):
78
+ #u1, u2 = st.columns(3)
79
+
80
+ #red = u1.checkbox("Show red items.", True)
81
+ #blue = u2.checkbox("Show blue items.", True)
82
+
83
+ cols = st.columns(3) # split into 3 columns
84
+ selected = []
85
+ for i, opt in enumerate(part_opt):
86
+ if cols[i % 3].checkbox(opt):
87
+ selected.append(opt)
88
 
89
  @st.cache_data
90
  def get_data(df):