Spaces:
Sleeping
Sleeping
Sw1ft0
commited on
Commit
·
fe06f0e
1
Parent(s):
44a1b9f
Fix different header cases handling to data loading section
Browse files
app.py
CHANGED
|
@@ -24,17 +24,25 @@ df2_all = pd.read_excel(
|
|
| 24 |
# Handle special header cases
|
| 25 |
df1 = {}
|
| 26 |
for sheet, raw_df in df1_all.items():
|
| 27 |
-
if sheet == "
|
| 28 |
-
# use row
|
| 29 |
df1[sheet] = pd.read_excel(
|
| 30 |
os.path.join("data_source", "OC Onboarding Information.xlsx"),
|
| 31 |
sheet_name=sheet,
|
| 32 |
-
header=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
)
|
| 34 |
else:
|
| 35 |
df1[sheet] = pd.read_excel(
|
| 36 |
os.path.join("data_source", "OC Onboarding Information.xlsx"),
|
| 37 |
-
sheet_name=sheet
|
|
|
|
| 38 |
)
|
| 39 |
|
| 40 |
df2 = {}
|
|
|
|
| 24 |
# Handle special header cases
|
| 25 |
df1 = {}
|
| 26 |
for sheet, raw_df in df1_all.items():
|
| 27 |
+
if sheet == "Budget":
|
| 28 |
+
# use row 3 as header
|
| 29 |
df1[sheet] = pd.read_excel(
|
| 30 |
os.path.join("data_source", "OC Onboarding Information.xlsx"),
|
| 31 |
sheet_name=sheet,
|
| 32 |
+
header=2
|
| 33 |
+
)
|
| 34 |
+
elif sheet == "Rooms per category":
|
| 35 |
+
# use row 4 as header
|
| 36 |
+
df1[sheet] = pd.read_excel(
|
| 37 |
+
os.path.join("data_source", "OC Onboarding Information.xlsx"),
|
| 38 |
+
sheet_name=sheet,
|
| 39 |
+
header=3
|
| 40 |
)
|
| 41 |
else:
|
| 42 |
df1[sheet] = pd.read_excel(
|
| 43 |
os.path.join("data_source", "OC Onboarding Information.xlsx"),
|
| 44 |
+
sheet_name=sheet,
|
| 45 |
+
header=1
|
| 46 |
)
|
| 47 |
|
| 48 |
df2 = {}
|