Gova823 commited on
Commit
be3c4eb
·
verified ·
1 Parent(s): 8b2c8ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -109,7 +109,17 @@ if 'y_test' not in st.session_state:
109
 
110
  if st.sidebar.button('Submit'):
111
  if data_set != "None":
112
- df = pd.read_csv('data_set')
 
 
 
 
 
 
 
 
 
 
113
  X = df.iloc[:, :2].values
114
  y = df.iloc[:, -1].values
115
  problem_type = 'Classification' # Treat as classification if dataset is chosen
 
109
 
110
  if st.sidebar.button('Submit'):
111
  if data_set != "None":
112
+ # df = pd.read_csv('data_set')
113
+ try:
114
+ # Read the CSV file using the provided file name
115
+ df = pd.read_csv(data_set)
116
+
117
+ # Display the DataFrame
118
+ st.write(df)
119
+ except FileNotFoundError:
120
+ st.error(f"File '{data_set}' not found. Please check the file name and try again.")
121
+ except Exception as e:
122
+ st.error(f"An error occurred: {e}")
123
  X = df.iloc[:, :2].values
124
  y = df.iloc[:, -1].values
125
  problem_type = 'Classification' # Treat as classification if dataset is chosen