Update appStore/tapp_display.py
Browse files- appStore/tapp_display.py +4 -2
appStore/tapp_display.py
CHANGED
@@ -68,15 +68,17 @@ def target_display():
|
|
68 |
|
69 |
cols = list(hits.columns)
|
70 |
sector_cols = list(set(cols) - {'TargetLabel','MitigationLabel','AdaptationLabel','GHGLabel','NetzeroLabel','NonGHGLabel','text','keep','page'})
|
71 |
-
|
|
|
72 |
placeholder= []
|
73 |
for col in sector_cols:
|
74 |
placeholder.append({'Sector':col,'Count':sum(hits[col] == True)})
|
|
|
75 |
sector_df = pd.DataFrame.from_dict(placeholder)
|
76 |
fig = px.bar(sector_df, x='Sector', y='Count')
|
77 |
st.plotly_chart(fig,use_container_width= True)
|
78 |
|
79 |
-
st.dataframe(hits)
|
80 |
else:
|
81 |
st.info("🤔 No Targets Found")
|
82 |
|
|
|
68 |
|
69 |
cols = list(hits.columns)
|
70 |
sector_cols = list(set(cols) - {'TargetLabel','MitigationLabel','AdaptationLabel','GHGLabel','NetzeroLabel','NonGHGLabel','text','keep','page'})
|
71 |
+
hits['Sector'] = hits.apply(lambda x: [col if x[col] == True for col in sector_cols],axis=1)
|
72 |
+
hits['Sub-Target'] = hits.apply(lambda x: [col if x[col] == True for col in ['GHGLabel','NetzeroLabel','NonGHGLabel'],axis=1)
|
73 |
placeholder= []
|
74 |
for col in sector_cols:
|
75 |
placeholder.append({'Sector':col,'Count':sum(hits[col] == True)})
|
76 |
+
hits['Sector']
|
77 |
sector_df = pd.DataFrame.from_dict(placeholder)
|
78 |
fig = px.bar(sector_df, x='Sector', y='Count')
|
79 |
st.plotly_chart(fig,use_container_width= True)
|
80 |
|
81 |
+
st.dataframe(hits[['text','page','keep','MitigationLabel','AdaptationLabel','Sector','Sub-Target',]])
|
82 |
else:
|
83 |
st.info("🤔 No Targets Found")
|
84 |
|