Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +23 -23
src/streamlit_app.py
CHANGED
@@ -195,29 +195,29 @@ init_session_state()
|
|
195 |
# Enhanced data loading with error handling
|
196 |
def run_app1():
|
197 |
|
198 |
-
@st.cache_data
|
199 |
-
def load_data():
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
|
222 |
# Enhanced RAM extraction with better parsing
|
223 |
def extract_numeric_ram(ram) -> Optional[int]:
|
|
|
195 |
# Enhanced data loading with error handling
|
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]:
|