Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,24 +28,18 @@ with st.sidebar:
|
|
| 28 |
selected_cik = st.selectbox('Select a company', cik_list, index=len(cik_list)-1)
|
| 29 |
df_selected_cik = df[df.CIK == selected_cik]
|
| 30 |
|
| 31 |
-
def make_esgScoresPlot(df, cik):
|
| 32 |
-
to_display = df[df['CIK'] == cik]
|
| 33 |
-
to_display['Year'] = to_display['Year'].astype('string')
|
| 34 |
-
to_display.sort_values('Year', inplace=True)
|
| 35 |
-
to_display.set_index('Year', inplace=True)
|
| 36 |
-
|
| 37 |
-
ax = sns.lineplot(data=to_display[['e_score', 's_score', 'g_score']] )
|
| 38 |
-
plt.xlabel('year')
|
| 39 |
-
plt.ylabel('score')
|
| 40 |
-
plt.title('ESG scores for ')
|
| 41 |
-
plt.legend(title='Legend', loc='upper left')
|
| 42 |
-
return ax
|
| 43 |
-
|
| 44 |
col = st.columns((1.5, 4.5, 2), gap='medium')
|
| 45 |
|
| 46 |
with col[1]:
|
| 47 |
st.markdown('#### ESG Scores')
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
|
|
|
| 28 |
selected_cik = st.selectbox('Select a company', cik_list, index=len(cik_list)-1)
|
| 29 |
df_selected_cik = df[df.CIK == selected_cik]
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
col = st.columns((1.5, 4.5, 2), gap='medium')
|
| 32 |
|
| 33 |
with col[1]:
|
| 34 |
st.markdown('#### ESG Scores')
|
| 35 |
|
| 36 |
+
to_display = df[df['CIK'] == selected_cik]
|
| 37 |
+
df_selected_cik['Year'] = df_selected_cik['Year'].astype('string')
|
| 38 |
+
df_selected_cik.sort_values('Year', inplace=True)
|
| 39 |
+
df_selected_cik.set_index('Year', inplace=True)
|
| 40 |
+
|
| 41 |
+
sns.lineplot(data=df_selected_cik[['e_score', 's_score', 'g_score']] )
|
| 42 |
+
plt.xlabel('year')
|
| 43 |
+
plt.ylabel('score')
|
| 44 |
+
plt.legend(title='Legend', loc='upper left')
|
| 45 |
|