Spaces:
Runtime error
Runtime error
chore: refactor
Browse files
app.py
CHANGED
@@ -72,19 +72,17 @@ with col2:
|
|
72 |
st.success("Blinking values have been removed!")
|
73 |
if "baseline" in list(df_right.keys()):
|
74 |
st.markdown(f"A **baseline** feature has been found on your data, do you want to merge it with any of the other features in a new calculated field?")
|
75 |
-
option = st.multiselect('Select a feature to merge', [k for k in list(df_right.keys()) if k != 'baseline'], [])
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
st.
|
85 |
-
|
86 |
-
st.download_button('Download CSV', f)
|
87 |
-
st.info("Your data has been downloaded, you can visualize and detect outliers in the 'Plotting' and 'Detect Outliers' pages on the sidebar.")
|
88 |
elif detect_blinking and not number_of_blinks:
|
89 |
st.caption("No blinking values were found in your data!")
|
90 |
|
|
|
72 |
st.success("Blinking values have been removed!")
|
73 |
if "baseline" in list(df_right.keys()):
|
74 |
st.markdown(f"A **baseline** feature has been found on your data, do you want to merge it with any of the other features in a new calculated field?")
|
75 |
+
option = st.multiselect('Select a feature to merge', [k for k in list(df_right.keys()) if k != 'baseline'], [[k for k in list(df_right.keys()) if k != 'baseline'][-2]])
|
76 |
+
relative_key = f"relative_{option[0]}"
|
77 |
+
add_relative = st.button(f"Add {relative_key}")
|
78 |
+
if add_relative:
|
79 |
+
baseline_mean = [sum(s)/len(s) for s in df['baseline']]
|
80 |
+
df_right['relative_pupil_dilation'] = [df[option[0]][i] - baseline_mean[i] for i in range(len(df))]
|
81 |
+
st.markdown("After adding calculated fields")
|
82 |
+
st.dataframe(df_right)
|
83 |
+
with open('myfile.csv') as f:
|
84 |
+
st.download_button('Download CSV', f)
|
85 |
+
st.info("Your data has been downloaded, you can visualize and detect outliers in the 'Plotting' and 'Detect Outliers' pages on the sidebar.")
|
|
|
|
|
86 |
elif detect_blinking and not number_of_blinks:
|
87 |
st.caption("No blinking values were found in your data!")
|
88 |
|