Mattral commited on
Commit
5df245e
·
verified ·
1 Parent(s): 7cc98c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -154,15 +154,19 @@ col3.markdown("<h5 align='center'> Write URL", unsafe_allow_html=True)
154
  col3.button("Write URL", key="write_url", use_container_width=True, on_click=url_click)
155
 
156
 
 
157
  # No Data
158
  if st.session_state.df is None:
159
 
160
  # Upload
161
  if uploading_way == "upload":
162
- uploaded_file = st.file_uploader("Upload the Dataset", type="csv")
163
  if uploaded_file:
164
- df = load_data(uploaded_file)
165
- st.session_state.df = df
 
 
 
166
 
167
  # Select
168
  elif uploading_way == "select":
 
154
  col3.button("Write URL", key="write_url", use_container_width=True, on_click=url_click)
155
 
156
 
157
+
158
  # No Data
159
  if st.session_state.df is None:
160
 
161
  # Upload
162
  if uploading_way == "upload":
163
+ uploaded_file = st.file_uploader("Upload the Dataset", type=["csv", "xlsx", "xls"])
164
  if uploaded_file:
165
+ try:
166
+ df = load_data(uploaded_file)
167
+ st.session_state.df = df
168
+ except Exception as e:
169
+ st.error(f"Error loading the file: {e}")
170
 
171
  # Select
172
  elif uploading_way == "select":