Jayesh13 commited on
Commit
2c0f1ac
·
verified ·
1 Parent(s): 50c6839

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -14,18 +14,18 @@ uploaded_file2 = st.file_uploader("Upload Second Excel File", type=["xlsx"])
14
 
15
  if uploaded_file1 and uploaded_file2:
16
  try:
17
- # Read files, header starts at second row (index 1)
18
- df1 = pd.read_excel(uploaded_file1, header=1)
19
- df2 = pd.read_excel(uploaded_file2, header=1)
20
 
21
  # Ensure column names are strings
22
  df1.columns = df1.columns.astype(str)
23
  df2.columns = df2.columns.astype(str)
24
 
25
- # Extract ID, Name, and Repeat columns
26
  id_col = df1.columns[0]
27
  name_col = df1.columns[1]
28
- repeat_columns = df1.columns[2:] # actual repeat names
29
 
30
  differences = []
31
 
@@ -51,7 +51,7 @@ if uploaded_file1 and uploaded_file2:
51
  differences.append({
52
  id_col: entry_id,
53
  name_col: protein_name,
54
- "Repeat": repeat_col, # ✅ actual repeat name from header
55
  "Frequency File 1": freq1,
56
  "Frequency File 2": freq2,
57
  "Difference": diff
 
14
 
15
  if uploaded_file1 and uploaded_file2:
16
  try:
17
+ # Read files: header is in the first row (index 0)
18
+ df1 = pd.read_excel(uploaded_file1, header=0)
19
+ df2 = pd.read_excel(uploaded_file2, header=0)
20
 
21
  # Ensure column names are strings
22
  df1.columns = df1.columns.astype(str)
23
  df2.columns = df2.columns.astype(str)
24
 
25
+ # Get ID and Name columns
26
  id_col = df1.columns[0]
27
  name_col = df1.columns[1]
28
+ repeat_columns = df1.columns[2:] # Repeat columns start from index 2
29
 
30
  differences = []
31
 
 
51
  differences.append({
52
  id_col: entry_id,
53
  name_col: protein_name,
54
+ "Repeat": repeat_col,
55
  "Frequency File 1": freq1,
56
  "Frequency File 2": freq2,
57
  "Difference": diff