Update src/streamlit_app.py
Browse files- src/streamlit_app.py +11 -4
src/streamlit_app.py
CHANGED
@@ -18,6 +18,7 @@ st.set_page_config(
|
|
18 |
layout="wide",
|
19 |
page_icon="🧠"
|
20 |
)
|
|
|
21 |
@st.cache_data
|
22 |
def load_data():
|
23 |
paths = [
|
@@ -218,13 +219,19 @@ with st.sidebar:
|
|
218 |
|
219 |
# Individual Analysis
|
220 |
st.subheader("👤 Individual Student Analysis")
|
221 |
-
|
|
|
|
|
|
|
|
|
|
|
222 |
"Choose a student:",
|
223 |
-
options=
|
224 |
-
format_func=lambda x:
|
225 |
)
|
226 |
|
227 |
-
if
|
|
|
228 |
user_data = df[df["Full Name"] == selected_user].iloc[0]
|
229 |
|
230 |
col1, col2 = st.columns(2)
|
|
|
18 |
layout="wide",
|
19 |
page_icon="🧠"
|
20 |
)
|
21 |
+
|
22 |
@st.cache_data
|
23 |
def load_data():
|
24 |
paths = [
|
|
|
219 |
|
220 |
# Individual Analysis
|
221 |
st.subheader("👤 Individual Student Analysis")
|
222 |
+
|
223 |
+
# Fixed selectbox - use index-based selection
|
224 |
+
student_names = list(df["Full Name"].unique())
|
225 |
+
student_options = ["Select a student..."] + student_names
|
226 |
+
|
227 |
+
selected_index = st.selectbox(
|
228 |
"Choose a student:",
|
229 |
+
options=range(len(student_options)),
|
230 |
+
format_func=lambda x: student_options[x]
|
231 |
)
|
232 |
|
233 |
+
if selected_index > 0: # If not the placeholder option
|
234 |
+
selected_user = student_names[selected_index - 1]
|
235 |
user_data = df[df["Full Name"] == selected_user].iloc[0]
|
236 |
|
237 |
col1, col2 = st.columns(2)
|