-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHome.py
More file actions
333 lines (252 loc) · 11.1 KB
/
Home.py
File metadata and controls
333 lines (252 loc) · 11.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
import streamlit as st
from utils.charts import (
divergent_bar_chart,
generate_bar_chart,
generate_cumulative_frequency_chart,
generate_cumulative_percentage_chart,
generate_donut_chart,
likert_scale_chart,
)
from utils.constants import PRE_PROGRAM_DATA, load_data
from utils.data_extraction import get_sentiment
from utils.data_preparation import clean_pre_program_data, create_pivot_table
st.set_page_config(
page_title="EIT Dashboard",
page_icon="👋",
layout="wide",
initial_sidebar_state="collapsed",
)
st.title("EIT SURVEY DASHBOARD")
st.markdown("### Welcome to the EIT Survey Dashboard! 🚀")
def pre_program_dashboard():
# load data
pre_program_data = load_data(PRE_PROGRAM_DATA)
df = clean_pre_program_data(pre_program_data)
pivot_table = create_pivot_table(df)
# display charts
tab1, tab2, tab3, tab4, tab5, tab6 = st.tabs(
[
"🗂️ Business",
"👨💻 Technology",
"💹 Marketing & Communications",
"📍 Soft Skills",
"📚 Program Experience",
"📣 Open Ended Questions",
]
)
with tab1:
st.write("## Business Skills Survey")
st.write("### Question:")
st.write(
"Before the EIT Program, how would you rate your proficiency in the following business skills?",
)
st.divider()
business_data = pivot_table[pivot_table["variable"].str.startswith("Business")]
st.write(
"### The following charts show the distribution of responses for each business skill."
)
col1, _, col2 = st.columns([1, 0.2, 1])
col1.plotly_chart(likert_scale_chart(business_data))
col2.plotly_chart(divergent_bar_chart(business_data))
st.divider()
st.write(
"### The following charts show the distribution of responses for selected business skill."
)
row = st.selectbox("Select a business skill", business_data["variable"], key=1)
col3, _, col4 = st.columns([1, 0.2, 1])
col3.write("#### Bar Chart")
col3.plotly_chart(generate_bar_chart(business_data, row))
col4.write("#### Pie Chart")
col4.plotly_chart(generate_donut_chart(business_data, row))
st.divider()
st.write(
"### The following charts show the cumulative frequency and percentage of responses for selected business skill."
)
row = st.selectbox("Select a business skill", business_data["variable"], key=2)
col5, _, col6 = st.columns([1, 0.2, 1])
col5.write("#### Cumulative Frequency Chart")
col5.plotly_chart(generate_cumulative_frequency_chart(business_data, row))
col6.write("#### Cumulative Percentage Chart")
col6.plotly_chart(generate_cumulative_percentage_chart(business_data, row))
with tab2:
st.write("## Technology Skills Survey")
st.write("### Question:")
st.write(
"Before the EIT Program, how would you rate your proficiency in the following technology skills?"
)
st.divider()
technology_data = pivot_table[
pivot_table["variable"].str.startswith("Technology")
]
col1, _, col2 = st.columns([1, 0.2, 1])
col1.plotly_chart(likert_scale_chart(technology_data))
col2.plotly_chart(divergent_bar_chart(technology_data))
st.divider()
st.write(
"### The following charts show the distribution of responses for selected technology skill."
)
row = st.selectbox(
"Select a technology skill", technology_data["variable"], key=3
)
col3, _, col4 = st.columns([1, 0.2, 1])
col3.write("#### Bar Chart")
col3.plotly_chart(generate_bar_chart(technology_data, row))
col4.write("#### Pie Chart")
col4.plotly_chart(generate_donut_chart(technology_data, row))
st.divider()
st.write(
"### The following charts show the cumulative frequency and percentage of responses for selected technology skill."
)
row = st.selectbox(
"Select a technology skill", technology_data["variable"], key=4
)
col5, _, col6 = st.columns([1, 0.2, 1])
col5.write("#### Cumulative Frequency Chart")
col5.plotly_chart(generate_cumulative_frequency_chart(technology_data, row))
col6.write("#### Cumulative Percentage Chart")
col6.plotly_chart(generate_cumulative_percentage_chart(technology_data, row))
with tab3:
st.write("## Marketing & Communications Skills Survey")
st.write("### Question:")
st.write(
"Before the EIT Program, how would you rate your proficiency in the following marketing & communications skills?"
)
st.divider()
marketing_data = pivot_table[
pivot_table["variable"].str.startswith("Communication")
]
st.write(
"### The following charts show the distribution of responses for each communication skill."
)
col1, _, col2 = st.columns([1, 0.2, 1])
col1.plotly_chart(likert_scale_chart(marketing_data))
col2.plotly_chart(divergent_bar_chart(marketing_data))
st.divider()
st.write(
"### The following charts show the distribution of responses for selected communication skill."
)
row = st.selectbox(
"Select a communication skill", marketing_data["variable"], key=5
)
col3, _, col4 = st.columns([1, 0.2, 1])
col3.write("#### Bar Chart")
col3.plotly_chart(generate_bar_chart(marketing_data, row))
col4.write("#### Pie Chart")
col4.plotly_chart(generate_donut_chart(marketing_data, row))
st.divider()
st.write(
"### The following charts show the cumulative frequency and percentage of responses for selected communication skill."
)
row = st.selectbox(
"Select a communication skill", marketing_data["variable"], key=6
)
col5, _, col6 = st.columns([1, 0.2, 1])
col5.write("#### Cumulative Frequency Chart")
col5.plotly_chart(generate_cumulative_frequency_chart(marketing_data, row))
col6.write("#### Cumulative Percentage Chart")
col6.plotly_chart(generate_cumulative_percentage_chart(marketing_data, row))
with tab4:
st.write("## Soft Skills Survey")
st.write("### Question:")
st.write(
"Before the EIT Program, how would you rate your proficiency in the following soft skills areas?",
)
st.divider()
soft_skills_data = pivot_table[
pivot_table["variable"].str.startswith("Soft_Skill")
]
st.write(
"### The following charts show the distribution of responses for each soft skill."
)
col1, _, col2 = st.columns([1, 0.2, 1])
col1.plotly_chart(likert_scale_chart(soft_skills_data))
col2.plotly_chart(divergent_bar_chart(soft_skills_data))
st.divider()
st.write(
"### The following charts show the distribution of responses for selected business skill."
)
row = st.selectbox(
"Select a business skill", soft_skills_data["variable"], key=7
)
col3, _, col4 = st.columns([1, 0.2, 1])
col3.write("#### Bar Chart")
col3.plotly_chart(generate_bar_chart(soft_skills_data, row))
col4.write("#### Pie Chart")
col4.plotly_chart(generate_donut_chart(soft_skills_data, row))
st.divider()
st.write(
"### The following charts show the cumulative frequency and percentage of responses for selected business skill."
)
row = st.selectbox(
"Select a business skill", soft_skills_data["variable"], key=8
)
col5, _, col6 = st.columns([1, 0.2, 1])
col5.write("#### Cumulative Frequency Chart")
col5.plotly_chart(generate_cumulative_frequency_chart(soft_skills_data, row))
col6.write("#### Cumulative Percentage Chart")
col6.plotly_chart(generate_cumulative_percentage_chart(soft_skills_data, row))
with tab5:
st.write("## Program Experience Survey")
st.write("### Question:")
st.write("How would you evaluate the following components of the program?")
st.divider()
program_experience_data = pivot_table[
pivot_table["variable"].str.startswith("Program")
]
st.write(
"### The following charts show the distribution of responses for each program experience."
)
col1, _, col2 = st.columns([1, 0.2, 1])
col1.plotly_chart(likert_scale_chart(program_experience_data))
col2.plotly_chart(divergent_bar_chart(program_experience_data))
st.divider()
st.write(
"### The following charts show the distribution of responses for selected program experience."
)
row = st.selectbox(
"Select a program experience", program_experience_data["variable"], key=9
)
col3, _, col4 = st.columns([1, 0.2, 1])
col3.write("#### Bar Chart")
col3.plotly_chart(generate_bar_chart(program_experience_data, row))
col4.write("#### Pie Chart")
col4.plotly_chart(generate_donut_chart(program_experience_data, row))
st.divider()
st.write(
"### The following charts show the cumulative frequency and percentage of responses for selected program experience."
)
row = st.selectbox(
"Select a program experience", program_experience_data["variable"], key=10
)
col5, _, col6 = st.columns([1, 0.2, 1])
col5.write("#### Cumulative Frequency Chart")
col5.plotly_chart(
generate_cumulative_frequency_chart(program_experience_data, row)
)
col6.write("#### Cumulative Percentage Chart")
col6.plotly_chart(
generate_cumulative_percentage_chart(program_experience_data, row)
)
with tab6:
st.write("## Open Ended Questions")
st.write("### If any, what further assistance would you have preferred?")
open_ended_response_data = df[
"If_any_what_further_assistance_would_you_have_preferred"
]
# remove missing values from the open ended response data
open_ended_response_data = open_ended_response_data.dropna()
col1, col2, col3 = st.columns([1, 1, 1])
col1.markdown("### Positive Sentiments")
col2.markdown("### Neutral Sentiments")
col3.markdown("### Negative Sentiments")
# display the open ended responses as comments in a card layout
for _, response in enumerate(open_ended_response_data, 1):
sentiment = get_sentiment(response)
if sentiment > 0:
col1.success(f"{response}\n\n**Sentiment Score: {sentiment:.2f}**")
elif sentiment < 0:
col3.error(f"{response}\n\n**Sentiment Score: {sentiment:.2f}**")
else:
col2.warning(f"{response}\n\n**Sentiment Score: {sentiment:.2f}**")
if __name__ == "__main__":
pre_program_dashboard()