ppsingh commited on
Commit
f09c179
1 Parent(s): 87f10eb

Update appStore/tapp_display.py

Browse files
Files changed (1) hide show
  1. appStore/tapp_display.py +12 -0
appStore/tapp_display.py CHANGED
@@ -72,6 +72,9 @@ def target_display():
72
  #st.write('----------------')
73
 
74
  st.session_state['target_hits'] = hits[['keep','text','Sector','Sub-Target','page','MitigationLabel','AdaptationLabel']]
 
 
 
75
  placeholder= []
76
  for col in sector_cols:
77
  placeholder.append({'Sector':col,'Count':sum(hits[col] == True)})
@@ -125,6 +128,9 @@ def action_display():
125
  #st.markdown("<h4 style='text-align: left; color: black;'> Sectoral Action Related Paragraphs Count </h4>", unsafe_allow_html=True)
126
 
127
  st.session_state['action_hits'] = hits[['text','page','keep','Sector','MitigationLabel','AdaptationLabel',]]
 
 
 
128
  #hits['Sub-Target'] = hits.apply(lambda x: [col for col in ['GHGLabel','NetzeroLabel','NonGHGLabel'] if x[col] == True ],axis=1)
129
  placeholder= []
130
  for col in sector_cols:
@@ -177,6 +183,9 @@ def policy_display():
177
  #st.write('----------------')
178
 
179
  st.session_state['policy_hits'] = hits[['text','page','keep','Sector','MitigationLabel','AdaptationLabel']]
 
 
 
180
  placeholder= []
181
  for col in sector_cols:
182
  placeholder.append({'Sector':col,'Count':sum(hits[col] == True)})
@@ -225,6 +234,9 @@ def plans_display():
225
  #st.write('----------------')
226
 
227
  st.session_state['plan_hits'] = hits[['text','page','keep','Sector','MitigationLabel','AdaptationLabel']]
 
 
 
228
  placeholder= []
229
  for col in sector_cols:
230
  placeholder.append({'Sector':col,'Count':sum(hits[col] == True)})
 
72
  #st.write('----------------')
73
 
74
  st.session_state['target_hits'] = hits[['keep','text','Sector','Sub-Target','page','MitigationLabel','AdaptationLabel']]
75
+ cols = list(hits.columns)
76
+ sector_cols = list(set(cols) - {'TargetLabel','MitigationLabel','AdaptationLabel','GHGLabel','NetzeroLabel','NonGHGLabel','text','keep','page','Sector','Sub-Target'})
77
+ sector_cols.sort()
78
  placeholder= []
79
  for col in sector_cols:
80
  placeholder.append({'Sector':col,'Count':sum(hits[col] == True)})
 
128
  #st.markdown("<h4 style='text-align: left; color: black;'> Sectoral Action Related Paragraphs Count </h4>", unsafe_allow_html=True)
129
 
130
  st.session_state['action_hits'] = hits[['text','page','keep','Sector','MitigationLabel','AdaptationLabel',]]
131
+ cols = list(hits.columns)
132
+ sector_cols = list(set(cols) - {'ActionLabel','MitigationLabel','AdaptationLabel','GHGLabel','NetzeroLabel','NonGHGLabel','text','keep','page','Sector'})
133
+ sector_cols.sort()
134
  #hits['Sub-Target'] = hits.apply(lambda x: [col for col in ['GHGLabel','NetzeroLabel','NonGHGLabel'] if x[col] == True ],axis=1)
135
  placeholder= []
136
  for col in sector_cols:
 
183
  #st.write('----------------')
184
 
185
  st.session_state['policy_hits'] = hits[['text','page','keep','Sector','MitigationLabel','AdaptationLabel']]
186
+ cols = list(hits.columns)
187
+ sector_cols = list(set(cols) - {'PolicyLabel','MitigationLabel','AdaptationLabel','GHGLabel','NetzeroLabel','NonGHGLabel','text','keep','page','Sector'})
188
+ sector_cols.sort()
189
  placeholder= []
190
  for col in sector_cols:
191
  placeholder.append({'Sector':col,'Count':sum(hits[col] == True)})
 
234
  #st.write('----------------')
235
 
236
  st.session_state['plan_hits'] = hits[['text','page','keep','Sector','MitigationLabel','AdaptationLabel']]
237
+ cols = list(hits.columns)
238
+ sector_cols = list(set(cols) - {'PlansLabel','MitigationLabel','AdaptationLabel','GHGLabel','NetzeroLabel','NonGHGLabel','text','keep','page','Sector'})
239
+ sector_cols.sort()
240
  placeholder= []
241
  for col in sector_cols:
242
  placeholder.append({'Sector':col,'Count':sum(hits[col] == True)})