Joshnicholas commited on
Commit
86b3ce8
·
verified ·
1 Parent(s): 7b99985

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -256,15 +256,15 @@ def apply_ocr(cell_coordinates, cropped_table):
256
  row_data = row_data + ["" for _ in range(max_num_columns - len(row_data))]
257
  data[str(idx)] = row_data
258
 
259
- # # write to csv
260
- # with open('output.csv','w') as result_file:
261
- # wr = csv.writer(result_file, dialect='excel')
262
 
263
- # for row, row_text in data.items():
264
- # wr.writerow(row_text)
265
 
266
- # # return as Pandas dataframe
267
- # df = pd.read_csv('output.csv')
268
 
269
  return data
270
 
 
256
  row_data = row_data + ["" for _ in range(max_num_columns - len(row_data))]
257
  data[str(idx)] = row_data
258
 
259
+ # write to csv
260
+ with open('output.csv','w') as result_file:
261
+ wr = csv.writer(result_file, dialect='excel')
262
 
263
+ for row, row_text in data.items():
264
+ wr.writerow(row_text)
265
 
266
+ # return as Pandas dataframe
267
+ df = pd.read_csv('output.csv')
268
 
269
  return data
270