kreemyyyy commited on
Commit
72df82a
·
verified ·
1 Parent(s): aa57af7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -16,7 +16,9 @@ def convert_schedule(file_path, direction):
16
  header2 = raw.iloc[1, 1:].astype(object)
17
 
18
  # Decide which header row to use: prefer second if fully populated
19
- if header2.notna().all() and not header2.str.startswith('Unnamed').any():
 
 
20
  days = header2.tolist()
21
  data_start = 2
22
  else:
 
16
  header2 = raw.iloc[1, 1:].astype(object)
17
 
18
  # Decide which header row to use: prefer second if fully populated
19
+ # FIX: Convert to string before using .str accessor and handle NaN values
20
+ header2_str = header2.fillna('').astype(str)
21
+ if header2.notna().all() and not header2_str.str.startswith('Unnamed').any():
22
  days = header2.tolist()
23
  data_start = 2
24
  else: