Rajesh0279 commited on
Commit
8bdd45b
·
verified ·
1 Parent(s): 0f5463f

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +20 -20
src/streamlit_app.py CHANGED
@@ -196,28 +196,28 @@ init_session_state()
196
  def run_app1():
197
 
198
  @st.cache_data
199
- def load_data():
200
- paths = [
201
- "src/BITS_INTERNS.xlsx",
202
- "src/ICFAI.xlsx"
203
- ]
204
 
205
- combined_df = pd.DataFrame()
206
- for path in paths:
207
- try:
208
- df = pd.read_excel(path, sheet_name="Form Responses 1")
209
- df.columns = df.columns.str.strip()
210
- combined_df = pd.concat([combined_df, df], ignore_index=True)
211
- except FileNotFoundError:
212
- return None, f"Excel file '{path}' not found. Please upload the file."
213
- except Exception as e:
214
- return None, f"Error loading '{path}': {str(e)}"
215
 
216
- # Return success case - this was missing!
217
- if combined_df.empty:
218
- return None, "No data found in Excel files."
219
- else:
220
- return combined_df, None
221
 
222
  # Enhanced RAM extraction with better parsing
223
  def extract_numeric_ram(ram) -> Optional[int]:
 
196
  def run_app1():
197
 
198
  @st.cache_data
199
+ def load_data():
200
+ paths = [
201
+ "src/BITS_INTERNS.xlsx",
202
+ "src/ICFAI.xlsx"
203
+ ]
204
 
205
+ combined_df = pd.DataFrame()
206
+ for path in paths:
207
+ try:
208
+ df = pd.read_excel(path, sheet_name="Form Responses 1")
209
+ df.columns = df.columns.str.strip()
210
+ combined_df = pd.concat([combined_df, df], ignore_index=True)
211
+ except FileNotFoundError:
212
+ return None, f"Excel file '{path}' not found. Please upload the file."
213
+ except Exception as e:
214
+ return None, f"Error loading '{path}': {str(e)}"
215
 
216
+ # Return success case - this was missing!
217
+ if combined_df.empty:
218
+ return None, "No data found in Excel files."
219
+ else:
220
+ return combined_df, None
221
 
222
  # Enhanced RAM extraction with better parsing
223
  def extract_numeric_ram(ram) -> Optional[int]: