ppsingh commited on
Commit
264365c
1 Parent(s): d9f847a

Update appStore/tapp_display.py

Browse files
Files changed (1) hide show
  1. appStore/tapp_display.py +10 -3
appStore/tapp_display.py CHANGED
@@ -118,6 +118,9 @@ def action_display():
118
  st.markdown("<h4 style='text-align: left; color: black;'> Sectoral Action Related Paragraphs Count </h4>", unsafe_allow_html=True)
119
  cols = list(hits.columns)
120
  sector_cols = list(set(cols) - {'ActionLabel','MitigationLabel','AdaptationLabel','GHGLabel','NetzeroLabel','NonGHGLabel','text','keep','page'})
 
 
 
121
  placeholder= []
122
  for col in sector_cols:
123
  placeholder.append({'Sector':col,'Count':sum(hits[col] == True)})
@@ -125,7 +128,7 @@ def action_display():
125
  fig = px.bar(sector_df, x='Sector', y='Count')
126
  st.plotly_chart(fig,use_container_width= True)
127
 
128
- st.dataframe(hits)
129
  else:
130
  st.info("🤔 No Actions Found")
131
 
@@ -164,6 +167,8 @@ def policy_display():
164
  st.markdown("<h4 style='text-align: left; color: black;'> Sectoral Policy Related Paragraphs Count </h4>", unsafe_allow_html=True)
165
  cols = list(hits.columns)
166
  sector_cols = list(set(cols) - {'PolicyLabel','MitigationLabel','AdaptationLabel','GHGLabel','NetzeroLabel','NonGHGLabel','text','keep','page'})
 
 
167
  placeholder= []
168
  for col in sector_cols:
169
  placeholder.append({'Sector':col,'Count':sum(hits[col] == True)})
@@ -171,7 +176,7 @@ def policy_display():
171
  fig = px.bar(sector_df, x='Sector', y='Count')
172
  st.plotly_chart(fig,use_container_width= True)
173
 
174
- st.dataframe(hits)
175
  else:
176
  st.info("🤔 No Policy Found")
177
 
@@ -208,6 +213,8 @@ def plans_display():
208
  st.markdown("<h4 style='text-align: left; color: black;'> Sectoral Plans Related Paragraphs Count </h4>", unsafe_allow_html=True)
209
  cols = list(hits.columns)
210
  sector_cols = list(set(cols) - {'PlanLabel','MitigationLabel','AdaptationLabel','GHGLabel','NetzeroLabel','NonGHGLabel','text','keep','page'})
 
 
211
  placeholder= []
212
  for col in sector_cols:
213
  placeholder.append({'Sector':col,'Count':sum(hits[col] == True)})
@@ -215,7 +222,7 @@ def plans_display():
215
  fig = px.bar(sector_df, x='Sector', y='Count')
216
  st.plotly_chart(fig,use_container_width= True)
217
 
218
- st.dataframe(hits)
219
  else:
220
  st.info("🤔 No Plans Found")
221
 
 
118
  st.markdown("<h4 style='text-align: left; color: black;'> Sectoral Action Related Paragraphs Count </h4>", unsafe_allow_html=True)
119
  cols = list(hits.columns)
120
  sector_cols = list(set(cols) - {'ActionLabel','MitigationLabel','AdaptationLabel','GHGLabel','NetzeroLabel','NonGHGLabel','text','keep','page'})
121
+ sector_cols.sort()
122
+ hits['Sector'] = hits.apply(lambda x: [col for col in sector_cols if x[col] == True],axis=1)
123
+ #hits['Sub-Target'] = hits.apply(lambda x: [col for col in ['GHGLabel','NetzeroLabel','NonGHGLabel'] if x[col] == True ],axis=1)
124
  placeholder= []
125
  for col in sector_cols:
126
  placeholder.append({'Sector':col,'Count':sum(hits[col] == True)})
 
128
  fig = px.bar(sector_df, x='Sector', y='Count')
129
  st.plotly_chart(fig,use_container_width= True)
130
 
131
+ st.dataframe(hits[['text','page','keep','MitigationLabel','AdaptationLabel','Sector']])
132
  else:
133
  st.info("🤔 No Actions Found")
134
 
 
167
  st.markdown("<h4 style='text-align: left; color: black;'> Sectoral Policy Related Paragraphs Count </h4>", unsafe_allow_html=True)
168
  cols = list(hits.columns)
169
  sector_cols = list(set(cols) - {'PolicyLabel','MitigationLabel','AdaptationLabel','GHGLabel','NetzeroLabel','NonGHGLabel','text','keep','page'})
170
+ sector_cols.sort()
171
+ hits['Sector'] = hits.apply(lambda x: [col for col in sector_cols if x[col] == True],axis=1)
172
  placeholder= []
173
  for col in sector_cols:
174
  placeholder.append({'Sector':col,'Count':sum(hits[col] == True)})
 
176
  fig = px.bar(sector_df, x='Sector', y='Count')
177
  st.plotly_chart(fig,use_container_width= True)
178
 
179
+ st.dataframe(hits[['text','page','keep','MitigationLabel','AdaptationLabel','Sector']])
180
  else:
181
  st.info("🤔 No Policy Found")
182
 
 
213
  st.markdown("<h4 style='text-align: left; color: black;'> Sectoral Plans Related Paragraphs Count </h4>", unsafe_allow_html=True)
214
  cols = list(hits.columns)
215
  sector_cols = list(set(cols) - {'PlanLabel','MitigationLabel','AdaptationLabel','GHGLabel','NetzeroLabel','NonGHGLabel','text','keep','page'})
216
+ sector_cols.sort()
217
+ hits['Sector'] = hits.apply(lambda x: [col for col in sector_cols if x[col] == True],axis=1)
218
  placeholder= []
219
  for col in sector_cols:
220
  placeholder.append({'Sector':col,'Count':sum(hits[col] == True)})
 
222
  fig = px.bar(sector_df, x='Sector', y='Count')
223
  st.plotly_chart(fig,use_container_width= True)
224
 
225
+ st.dataframe(hits[['text','page','keep','MitigationLabel','AdaptationLabel','Sector']])
226
  else:
227
  st.info("🤔 No Plans Found")
228