qwerty45-uiop commited on
Commit
e4e41ee
·
verified ·
1 Parent(s): 4a06230

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +4 -7
src/streamlit_app.py CHANGED
@@ -25,22 +25,19 @@ st.set_page_config(
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}"
 
25
  @st.cache_data
26
  def load_data():
27
  try:
28
+ # Use actual file paths
29
  df1 = pd.read_excel("src/BITS_INTERNS.xlsx", sheet_name="Form Responses 1")
30
+ df2 = pd.read_excel("/mnt/data/Summer of AI - ICFAI (Responses) (3).xlsx")
31
+
 
32
  df1.columns = df1.columns.str.strip()
33
  df2.columns = df2.columns.str.strip()
34
 
35
+ # Find common columns and combine
36
  common_cols = list(set(df1.columns) & set(df2.columns))
37
  df1 = df1[common_cols]
38
  df2 = df2[common_cols]
39
 
 
40
  combined_df = pd.concat([df1, df2], ignore_index=True)
 
41
  return combined_df, None
42
  except FileNotFoundError as e:
43
  return None, f"File not found: {e}"