laverdes commited on
Commit
139e4cc
•
1 Parent(s): c66e5fb

fix: continuity from home page

Browse files
Files changed (1) hide show
  1. pages/1_📈_Plotting.py +17 -8
pages/1_📈_Plotting.py CHANGED
@@ -14,24 +14,33 @@ with st.sidebar:
14
  plot = st.radio("Select the kind of visualization:",('Feature collection', 'Users comparison', 'Data distribution'))
15
  file = st.file_uploader("Load CSV file", accept_multiple_files = False)
16
  if file:
17
- df = pd.read_csv(file, index_col = False)
18
- # df.index = df['Unnamed: 0'].tolist()
19
  try:
20
- del df['Unnamed: 0']
21
  except KeyError:
22
  pass
23
- if 'df' not in st.session_state:
24
- st.session_state['df'] = df
25
  st.success("Your data has been successfully loaded! 🤗")
26
 
27
  with tab1:
28
- if 'df' in st.session_state:
29
  st.caption("Your uploaded data:")
30
- st.dataframe(st.session_state.df)
 
 
 
 
 
 
 
 
 
31
  else:
32
  st.caption("Upload your data using the sidebar and select a plot-type to start :sunglasses:")
33
 
34
- df_base = st.session_state.df if 'df' in st.session_state else pd.DataFrame()
35
  n = len(df_base)
36
  col1, col2 = st.columns(2)
37
 
 
14
  plot = st.radio("Select the kind of visualization:",('Feature collection', 'Users comparison', 'Data distribution'))
15
  file = st.file_uploader("Load CSV file", accept_multiple_files = False)
16
  if file:
17
+ df_p = pd.read_csv(file, index_col = False)
18
+ # df_p.index = df_p['Unnamed: 0'].tolist()
19
  try:
20
+ del df_p['Unnamed: 0']
21
  except KeyError:
22
  pass
23
+ if 'df_p' not in st.session_state:
24
+ st.session_state['df_p'] = df_p
25
  st.success("Your data has been successfully loaded! 🤗")
26
 
27
  with tab1:
28
+ if 'df_p' in st.session_state:
29
  st.caption("Your uploaded data:")
30
+ st.dataframe(st.session_state.df_p)
31
+ elif 'df_right' in st.session_state:
32
+ st.caption("Your data:")
33
+ st.dataframe(st.session_state.df_right)
34
+ if 'df_p' not in st.session_state:
35
+ df_p = st.session_state.df_right
36
+ st.session_state['df_p'] = df_p
37
+ else:
38
+ df_p = st.session_state.df_right
39
+ st.session_state.df_p = df_p
40
  else:
41
  st.caption("Upload your data using the sidebar and select a plot-type to start :sunglasses:")
42
 
43
+ df_base = st.session_state.df_p if 'df_p' in st.session_state else pd.DataFrame()
44
  n = len(df_base)
45
  col1, col2 = st.columns(2)
46