Yara Kyrychenko
commited on
Commit
·
0f310a2
1
Parent(s):
f2ba3ee
upd subtitle
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ st.subheader("Explore misinformation susceptibility profiles across 24 countries
|
|
14 |
|
15 |
st.markdown("Data from yourmist.streamlit.app between June 19, 2023, and July 10, 2024, from individuals who completed the MIST and chose to share their score and all sociodemographic data with the researchers. Only countries with more than 250 complete submissions at the time of data collection are included.")
|
16 |
|
17 |
-
countries = ["All countries"] + list(df["Country"].unique())
|
18 |
|
19 |
selected_country = st.selectbox("Select a country (or All countries):", countries)
|
20 |
|
@@ -46,7 +46,8 @@ plot_df = filtered_df.groupby([selected_var]).agg(avg_score=('Score', 'mean')).r
|
|
46 |
plot_df['avg_score'] = plot_df['avg_score'].round(2)
|
47 |
plot_df = plot_df.sort_values(by=selected_var)
|
48 |
|
49 |
-
subtitle_text = f'In {selected_country} by {selected_var.capitalize()}.
|
|
|
50 |
|
51 |
color_scale = alt.Scale(domain=ordering_dict[selected_var])
|
52 |
|
@@ -58,7 +59,7 @@ chart = alt.Chart(plot_df).mark_bar().encode(
|
|
58 |
width=800,
|
59 |
height=600,
|
60 |
title={
|
61 |
-
"text": f'Average
|
62 |
"subtitle": subtitle_text,
|
63 |
"subtitleFontSize": 16,
|
64 |
"anchor": "start" ,
|
|
|
14 |
|
15 |
st.markdown("Data from yourmist.streamlit.app between June 19, 2023, and July 10, 2024, from individuals who completed the MIST and chose to share their score and all sociodemographic data with the researchers. Only countries with more than 250 complete submissions at the time of data collection are included.")
|
16 |
|
17 |
+
countries = ["All countries"] + sorted(list(df["Country"].unique()))
|
18 |
|
19 |
selected_country = st.selectbox("Select a country (or All countries):", countries)
|
20 |
|
|
|
46 |
plot_df['avg_score'] = plot_df['avg_score'].round(2)
|
47 |
plot_df = plot_df.sort_values(by=selected_var)
|
48 |
|
49 |
+
subtitle_text = [f'In {selected_country} by {selected_var.capitalize()}.',
|
50 |
+
f'N={num_obs}, Mean={mean_score}, SD={std_dev}']
|
51 |
|
52 |
color_scale = alt.Scale(domain=ordering_dict[selected_var])
|
53 |
|
|
|
59 |
width=800,
|
60 |
height=600,
|
61 |
title={
|
62 |
+
"text": f'Average MIST Score',
|
63 |
"subtitle": subtitle_text,
|
64 |
"subtitleFontSize": 16,
|
65 |
"anchor": "start" ,
|