laverdes commited on
Commit
bca9198
ยท
1 Parent(s): 823d19a

fix: check if df in st.session_state keys()

Browse files
Files changed (1) hide show
  1. 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
- st.info("Your data has {} samples.")
47
- n_plot = st.slider("How many samples do you want to plot in the same graph", list(range(n)))
48
- st.write(f"Action: {plot} using {n_plot} samples")
49
- st.button("Plot now! ๐Ÿ“Š")
 
 
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! ๐Ÿ“Š")