Spaces:
Runtime error
Runtime error
chore: added some emojis and improve messaging
Browse files
app.py
CHANGED
|
@@ -40,15 +40,15 @@ with col1:
|
|
| 40 |
df_base["len_pupil_dilation"] = df_base.pupil_dilation.map(lambda l: len(l))
|
| 41 |
df_base["len_baseline"] = df_base.baseline.map(lambda l: len(l))
|
| 42 |
st.info(f"number of files: {len(file_names)}")
|
| 43 |
-
st.markdown("Your original data")
|
| 44 |
st.dataframe(df_base)
|
| 45 |
else:
|
| 46 |
-
st.caption("Upload your data
|
| 47 |
|
| 48 |
with col2:
|
| 49 |
if not df_base.empty:
|
| 50 |
st.markdown("**Cleaning actions**")
|
| 51 |
-
detect_blinking = st.button("
|
| 52 |
number_of_blinks = 0
|
| 53 |
if detect_blinking:
|
| 54 |
# Initialization of session_state
|
|
@@ -69,7 +69,7 @@ with col2:
|
|
| 69 |
|
| 70 |
if "blinks" in st.session_state.keys():
|
| 71 |
st.info(f"blinking values (0.0) were found in {number_of_blinks} time-steps in all your data")
|
| 72 |
-
remove_blinking = st.button("Remove blinking")
|
| 73 |
# df in column 2
|
| 74 |
if remove_blinking:
|
| 75 |
df_right = st.session_state.df.copy(deep=True)
|
|
@@ -78,14 +78,14 @@ with col2:
|
|
| 78 |
st.session_state['df'] = df_right.copy(deep=True)
|
| 79 |
st.success("Blinking values have been removed!")
|
| 80 |
elif detect_blinking and not number_of_blinks:
|
| 81 |
-
st.caption("No blinking values were found in your data!")
|
| 82 |
|
| 83 |
with col2:
|
| 84 |
if 'df' in list(st.session_state.keys()):
|
| 85 |
df_right = st.session_state.df.copy(deep=True)
|
| 86 |
if "baseline" in list(df_right.keys()):
|
| 87 |
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?")
|
| 88 |
-
option = st.multiselect('Select a feature to
|
| 89 |
relative_key = f"relative_{option[0]}"
|
| 90 |
add_relative = st.button(f"Add {relative_key}")
|
| 91 |
if add_relative:
|
|
@@ -95,7 +95,7 @@ with col2:
|
|
| 95 |
st.dataframe(df_right)
|
| 96 |
csv = convert_df(df_right)
|
| 97 |
downl = st.download_button(
|
| 98 |
-
"
|
| 99 |
csv,
|
| 100 |
"file.csv",
|
| 101 |
"text/csv",
|
|
|
|
| 40 |
df_base["len_pupil_dilation"] = df_base.pupil_dilation.map(lambda l: len(l))
|
| 41 |
df_base["len_baseline"] = df_base.baseline.map(lambda l: len(l))
|
| 42 |
st.info(f"number of files: {len(file_names)}")
|
| 43 |
+
st.markdown("Your original data with some extra information about the length of the time-series fields")
|
| 44 |
st.dataframe(df_base)
|
| 45 |
else:
|
| 46 |
+
st.caption("Upload your data using the sidebar to start :sunglasses:")
|
| 47 |
|
| 48 |
with col2:
|
| 49 |
if not df_base.empty:
|
| 50 |
st.markdown("**Cleaning actions**")
|
| 51 |
+
detect_blinking = st.button("I want to clean my data 🤗")
|
| 52 |
number_of_blinks = 0
|
| 53 |
if detect_blinking:
|
| 54 |
# Initialization of session_state
|
|
|
|
| 69 |
|
| 70 |
if "blinks" in st.session_state.keys():
|
| 71 |
st.info(f"blinking values (0.0) were found in {number_of_blinks} time-steps in all your data")
|
| 72 |
+
remove_blinking = st.button("Remove blinking 🧹")
|
| 73 |
# df in column 2
|
| 74 |
if remove_blinking:
|
| 75 |
df_right = st.session_state.df.copy(deep=True)
|
|
|
|
| 78 |
st.session_state['df'] = df_right.copy(deep=True)
|
| 79 |
st.success("Blinking values have been removed!")
|
| 80 |
elif detect_blinking and not number_of_blinks:
|
| 81 |
+
st.caption("No blinking values were found in your data! ")
|
| 82 |
|
| 83 |
with col2:
|
| 84 |
if 'df' in list(st.session_state.keys()):
|
| 85 |
df_right = st.session_state.df.copy(deep=True)
|
| 86 |
if "baseline" in list(df_right.keys()):
|
| 87 |
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?")
|
| 88 |
+
option = st.multiselect('Select a feature to create relative calculated feature ➕', [k for k in list(df_right.keys()) if k != 'baseline'], [[k for k in list(df_right.keys()) if k != 'baseline'][-4]])
|
| 89 |
relative_key = f"relative_{option[0]}"
|
| 90 |
add_relative = st.button(f"Add {relative_key}")
|
| 91 |
if add_relative:
|
|
|
|
| 95 |
st.dataframe(df_right)
|
| 96 |
csv = convert_df(df_right)
|
| 97 |
downl = st.download_button(
|
| 98 |
+
"Download CSV 💾",
|
| 99 |
csv,
|
| 100 |
"file.csv",
|
| 101 |
"text/csv",
|