Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -378,15 +378,20 @@ def postprocess_dataframes(result_tables):
|
|
| 378 |
res = {}
|
| 379 |
for idx, table_df in enumerate(result_tables):
|
| 380 |
result_df = pd.DataFrame()
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 390 |
print(result_df.columns)
|
| 391 |
if len(result_df.columns) == 0:
|
| 392 |
result_df["name"] = table_df.iloc[:, 0].copy()
|
|
|
|
| 378 |
res = {}
|
| 379 |
for idx, table_df in enumerate(result_tables):
|
| 380 |
result_df = pd.DataFrame()
|
| 381 |
+
print("--1")
|
| 382 |
+
print(result_df)
|
| 383 |
+
print("--2")
|
| 384 |
+
print(result_df.to_json(orient="records"))
|
| 385 |
+
# for col in table_df.columns:
|
| 386 |
+
# if col.lower().startswith("item"):
|
| 387 |
+
# result_df["name"] = table_df[col].copy()
|
| 388 |
+
# if (
|
| 389 |
+
# col.lower().startswith("total")
|
| 390 |
+
# or col.lower().startswith("amount")
|
| 391 |
+
# or col.lower().startswith("cost")
|
| 392 |
+
# ):
|
| 393 |
+
# result_df["amount"] = table_df[col].copy()
|
| 394 |
+
print("--3")
|
| 395 |
print(result_df.columns)
|
| 396 |
if len(result_df.columns) == 0:
|
| 397 |
result_df["name"] = table_df.iloc[:, 0].copy()
|