king007 commited on
Commit
f02edf5
·
1 Parent(s): b214134

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -9
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
- for col in table_df.columns:
382
- if col.lower().startswith("item"):
383
- result_df["name"] = table_df[col].copy()
384
- if (
385
- col.lower().startswith("total")
386
- or col.lower().startswith("amount")
387
- or col.lower().startswith("cost")
388
- ):
389
- result_df["amount"] = table_df[col].copy()
 
 
 
 
 
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()