Update app.py
Browse files
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 |
-
|
|
|
|
|
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:
|