laverdes commited on
Commit
975e7b1
•
1 Parent(s): d3a3a91

feat: n samples and messaging improved Plotting

Browse files
Files changed (1) hide show
  1. pages/1_📈_Plotting.py +16 -5
pages/1_📈_Plotting.py CHANGED
@@ -3,9 +3,8 @@ import pandas as pd
3
 
4
 
5
  st.header("Plotting Time-Series Data")
6
- st.markdown("Users can load their time-series data in **.csv** format and select particular feature and plot-type to visualize it.\
7
  Go ahead and use the sidebar on the left to upload your data files and to start visualizing it!")
8
- st.caption("Upload your data using the sidebar to start and select a plot-type to start :sunglasses:")
9
 
10
 
11
  def plot_collection(plot_only_this, collection, number_of_desired_plots=0):
@@ -28,12 +27,24 @@ def plot_collection(plot_only_this, collection, number_of_desired_plots=0):
28
 
29
 
30
  with st.sidebar:
31
- plot = st.radio("Select the kind of visualization:",('Plot feature', 'Compare users', 'Plot distribution'))
32
  file = st.file_uploader("Load CSV file", accept_multiple_files = False)
33
  if file:
34
- df = pd.read_csv(file)
35
  if 'df' not in st.session_state:
36
  st.session_state['df'] = df
 
37
 
38
  if 'df' in list(st.session_state.keys()):
39
- st.dataframe(st.session_state.df)
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
 
5
  st.header("Plotting Time-Series Data")
6
+ st.markdown("Users can load their time-series data in **.csv** format and select a particular feature and plot-type to visualize it.\
7
  Go ahead and use the sidebar on the left to upload your data files and to start visualizing it!")
 
8
 
9
 
10
  def plot_collection(plot_only_this, collection, number_of_desired_plots=0):
 
27
 
28
 
29
  with st.sidebar:
30
+ plot = st.radio("Select the kind of visualization:",('Plot feature collection', 'Compare users', 'Plot distribution'))
31
  file = st.file_uploader("Load CSV file", accept_multiple_files = False)
32
  if file:
33
+ df = pd.read_csv(file, index_col = False)
34
  if 'df' not in st.session_state:
35
  st.session_state['df'] = df
36
+ st.success("Your data has been successfully loaded! 🤗")
37
 
38
  if 'df' in list(st.session_state.keys()):
39
+ st.markdown("Your uploaded data:")
40
+ st.dataframe(st.session_state.df)
41
+ else:
42
+ else:
43
+ st.caption("Upload your data using the sidebar and select a plot-type to start :sunglasses:")
44
+
45
+ df_base = st.dataframe(st.session_state.df)
46
+ n = len(df_base)
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! 📊")