Spaces:
Runtime error
Runtime error
chore: typos and print session state
Browse files- pages/1_📈_Plotting.py +8 -7
pages/1_📈_Plotting.py
CHANGED
@@ -5,7 +5,7 @@ import time
|
|
5 |
|
6 |
st.header("Plotting Time Series Data")
|
7 |
st.markdown("Users can load their time-series data in **.csv** format and select a particular feature and plot-type.\
|
8 |
-
Go ahead and use the sidebar on the left to upload your data files
|
9 |
|
10 |
with st.sidebar:
|
11 |
plot = st.radio("Select the kind of visualization:",('Feature collection', 'Users comparison', 'Data distribution'))
|
@@ -21,17 +21,17 @@ with st.sidebar:
|
|
21 |
st.session_state['df'] = df
|
22 |
st.success("Your data has been successfully loaded! 🤗")
|
23 |
|
24 |
-
if 'df' in
|
25 |
-
st.caption("Your uploaded data:")
|
26 |
st.dataframe(st.session_state.df)
|
27 |
else:
|
28 |
st.caption("Upload your data using the sidebar and select a plot-type to start :sunglasses:")
|
29 |
|
30 |
-
df_base = st.session_state.df if 'df' in
|
31 |
n = len(df_base)
|
32 |
col1, col2 = st.columns(2)
|
33 |
|
34 |
-
if not df_base.empty:
|
35 |
with col1:
|
36 |
st.info(f"Your data has {n} samples.")
|
37 |
slider_range = list(range(n))
|
@@ -54,7 +54,7 @@ if not df_base.empty:
|
|
54 |
st.caption("The chart above shows...")
|
55 |
#
|
56 |
# with col2:
|
57 |
-
if 'df_plot' in
|
58 |
with st.spinner(f"Drawing plot to visualize {plot.lower()}"):
|
59 |
st.caption("Your visualization:")
|
60 |
st.caption("df_plot:")
|
@@ -68,4 +68,5 @@ if 'df_plot' in list(st.session_state.keys()):
|
|
68 |
st.dataframe(df_plot_t)
|
69 |
st.line_chart(df_plot_t, y=list(df_plot_t.columns), height=600, width=600)
|
70 |
elif df_base.empty and file:
|
71 |
-
st.warning("Consider running outlier detection to clean your data!", icon="⚠️")
|
|
|
|
5 |
|
6 |
st.header("Plotting Time Series Data")
|
7 |
st.markdown("Users can load their time-series data in **.csv** format and select a particular feature and plot-type.\
|
8 |
+
Go ahead and use the sidebar on the left to upload your data files to start visualizing it!")
|
9 |
|
10 |
with st.sidebar:
|
11 |
plot = st.radio("Select the kind of visualization:",('Feature collection', 'Users comparison', 'Data distribution'))
|
|
|
21 |
st.session_state['df'] = df
|
22 |
st.success("Your data has been successfully loaded! 🤗")
|
23 |
|
24 |
+
if 'df' in st.session_state:
|
25 |
+
st.caption("Your uploaded data:")
|
26 |
st.dataframe(st.session_state.df)
|
27 |
else:
|
28 |
st.caption("Upload your data using the sidebar and select a plot-type to start :sunglasses:")
|
29 |
|
30 |
+
df_base = st.session_state.df if 'df' in st.session_state else pd.DataFrame()
|
31 |
n = len(df_base)
|
32 |
col1, col2 = st.columns(2)
|
33 |
|
34 |
+
if not df_base.empty and not n:
|
35 |
with col1:
|
36 |
st.info(f"Your data has {n} samples.")
|
37 |
slider_range = list(range(n))
|
|
|
54 |
st.caption("The chart above shows...")
|
55 |
#
|
56 |
# with col2:
|
57 |
+
if 'df_plot' in st.session_state:
|
58 |
with st.spinner(f"Drawing plot to visualize {plot.lower()}"):
|
59 |
st.caption("Your visualization:")
|
60 |
st.caption("df_plot:")
|
|
|
68 |
st.dataframe(df_plot_t)
|
69 |
st.line_chart(df_plot_t, y=list(df_plot_t.columns), height=600, width=600)
|
70 |
elif df_base.empty and file:
|
71 |
+
st.warning("Consider running outlier detection to clean your data!", icon="⚠️")
|
72 |
+
st.caption(f"developer:: session_state keys: {list(session_state.keys())}")
|