Atharva Thakur commited on
Commit
411dde3
1 Parent(s): 61e1f0d

added try except block

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -18,9 +18,10 @@ def main():
18
  if st.button('Load Data'):
19
  data_loader = DataLoader()
20
  data_loader.load_data(uploaded_file)
21
-
22
- data = pd.read_csv("data.csv")
23
-
 
24
  if os.path.getsize("data.csv") != 0:
25
  with st.sidebar:
26
  selected = option_menu(
 
18
  if st.button('Load Data'):
19
  data_loader = DataLoader()
20
  data_loader.load_data(uploaded_file)
21
+ try:
22
+ data = pd.read_csv("data.csv")
23
+ except:
24
+ st.write("Please upload a csv file")
25
  if os.path.getsize("data.csv") != 0:
26
  with st.sidebar:
27
  selected = option_menu(