Spaces:
Runtime error
Runtime error
fix: check if df in st.session_state keys()
Browse files- pages/1_๐_Plotting.py +6 -5
pages/1_๐_Plotting.py
CHANGED
@@ -41,9 +41,10 @@ if 'df' in list(st.session_state.keys()):
|
|
41 |
else:
|
42 |
st.caption("Upload your data using the sidebar and select a plot-type to start :sunglasses:")
|
43 |
|
44 |
-
df_base = st.dataframe(st.session_state.df)
|
45 |
n = len(df_base)
|
46 |
-
|
47 |
-
|
48 |
-
st.
|
49 |
-
st.
|
|
|
|
41 |
else:
|
42 |
st.caption("Upload your data using the sidebar and select a plot-type to start :sunglasses:")
|
43 |
|
44 |
+
df_base = st.dataframe(st.session_state.df) if 'df' in list(st.session_state.keys()) else pd.DataFrame()
|
45 |
n = len(df_base)
|
46 |
+
if n:
|
47 |
+
st.info("Your data has {} samples.")
|
48 |
+
n_plot = st.slider("How many samples do you want to plot in the same graph", list(range(n)))
|
49 |
+
st.write(f"Action: {plot} using {n_plot} samples")
|
50 |
+
st.button("Plot now! ๐")
|