Update src/streamlit_app.py
Browse files- src/streamlit_app.py +20 -5
src/streamlit_app.py
CHANGED
@@ -25,14 +25,29 @@ st.set_page_config(
|
|
25 |
@st.cache_data
|
26 |
def load_data():
|
27 |
try:
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
except Exception as e:
|
34 |
return None, f"Error loading data: {str(e)}"
|
35 |
|
|
|
36 |
# Enhanced RAM extraction with better parsing
|
37 |
def extract_numeric_ram(ram) -> Optional[int]:
|
38 |
if pd.isna(ram):
|
|
|
25 |
@st.cache_data
|
26 |
def load_data():
|
27 |
try:
|
28 |
+
# Load both Excel files
|
29 |
+
df1 = pd.read_excel("src/BITS_INTERNS.xlsx", sheet_name="Form Responses 1")
|
30 |
+
df2 = pd.read_excel("Summer of AI - ICFAI (Responses) (3).xlsx")
|
31 |
+
|
32 |
+
# Clean column names
|
33 |
+
df1.columns = df1.columns.str.strip()
|
34 |
+
df2.columns = df2.columns.str.strip()
|
35 |
+
|
36 |
+
# Standardize columns between datasets (if needed)
|
37 |
+
common_cols = list(set(df1.columns) & set(df2.columns))
|
38 |
+
df1 = df1[common_cols]
|
39 |
+
df2 = df2[common_cols]
|
40 |
+
|
41 |
+
# Merge the data (stack on top of each other)
|
42 |
+
combined_df = pd.concat([df1, df2], ignore_index=True)
|
43 |
+
|
44 |
+
return combined_df, None
|
45 |
+
except FileNotFoundError as e:
|
46 |
+
return None, f"File not found: {e}"
|
47 |
except Exception as e:
|
48 |
return None, f"Error loading data: {str(e)}"
|
49 |
|
50 |
+
|
51 |
# Enhanced RAM extraction with better parsing
|
52 |
def extract_numeric_ram(ram) -> Optional[int]:
|
53 |
if pd.isna(ram):
|