Update src/streamlit_app.py
Browse files- src/streamlit_app.py +22 -29
src/streamlit_app.py
CHANGED
@@ -25,40 +25,33 @@ st.set_page_config(
|
|
25 |
@st.cache_data
|
26 |
def load_data():
|
27 |
try:
|
28 |
-
# Load BITS
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
# Load ICFAI
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
#
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
41 |
"Laptop OS": "Laptop Operating System",
|
42 |
"Mobile OS": "Mobile Operating System"
|
43 |
-
})
|
44 |
|
45 |
-
#
|
46 |
-
|
47 |
-
|
48 |
-
icfai_df = icfai_df[common_columns]
|
49 |
-
|
50 |
-
# Add source tags
|
51 |
-
bits_df["Institute"] = "BITS"
|
52 |
-
icfai_df["Institute"] = "ICFAI"
|
53 |
-
|
54 |
-
# Combine datasets
|
55 |
-
combined_df = pd.concat([bits_df, icfai_df], ignore_index=True)
|
56 |
-
|
57 |
-
st.info("✅ Loaded and merged data from BITS and ICFAI.")
|
58 |
-
return combined_df, None
|
59 |
|
60 |
except Exception as e:
|
61 |
-
return None, f"Error loading
|
62 |
|
63 |
|
64 |
# Enhanced RAM extraction with better parsing
|
|
|
25 |
@st.cache_data
|
26 |
def load_data():
|
27 |
try:
|
28 |
+
# Load BITS file
|
29 |
+
df_bits = pd.read_excel("/mnt/data/BITS_INTERNS.xlsx", sheet_name="Form Responses 1")
|
30 |
+
df_bits["Source"] = "BITS"
|
31 |
+
|
32 |
+
# Load ICFAI file
|
33 |
+
df_icfai = pd.read_excel("/mnt/data/Summer of AI - ICFAI (Responses) (3).xlsx", sheet_name=0)
|
34 |
+
df_icfai["Source"] = "ICFAI"
|
35 |
+
|
36 |
+
# Align columns by renaming if needed (e.g., if column names differ)
|
37 |
+
df_bits.columns = df_bits.columns.str.strip()
|
38 |
+
df_icfai.columns = df_icfai.columns.str.strip()
|
39 |
+
|
40 |
+
# Optional: Rename columns in ICFAI to match BITS (only if necessary)
|
41 |
+
df_icfai.rename(columns={
|
42 |
+
"Your Full Name": "Full Name",
|
43 |
+
"Laptop RAM Capacity": "Laptop RAM",
|
44 |
+
"Mobile RAM Capacity": "Mobile RAM",
|
45 |
"Laptop OS": "Laptop Operating System",
|
46 |
"Mobile OS": "Mobile Operating System"
|
47 |
+
}, inplace=True)
|
48 |
|
49 |
+
# Combine both
|
50 |
+
df_combined = pd.concat([df_bits, df_icfai], ignore_index=True)
|
51 |
+
return df_combined, None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
except Exception as e:
|
54 |
+
return None, f"❌ Error loading Excel files: {str(e)}"
|
55 |
|
56 |
|
57 |
# Enhanced RAM extraction with better parsing
|