XPMaster commited on
Commit
266ecaa
·
1 Parent(s): 8e1f10c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -246,8 +246,8 @@ def fill_missing_quarters(df, lob, acc, transaction):
246
  l_missing_df[lob] = l
247
  missing_quarters.append(l_missing_df)
248
 
249
- filled.append([lobs_dict.keys(),lobs_dict[col]])
250
- filled.append("Total paddings (0.1): "+str(missing_count))
251
  print("=="*100)
252
  print('Unique values in', acc, 'for missing quarters:', l_missing_df[acc].unique())
253
  # Concatenate the original dataframe and the missing quarters dataframe
@@ -636,17 +636,21 @@ def process(files,button):
636
  if len(filled_warn) == 0:
637
  filled_warn = ['No fillings']
638
  else:
639
- tempt_list = [element for element in filled_warn[-2][0] if element in columns]
640
- filled_warn[-2] = "Padded columns "+str(list(tempt_list))+" with total of "+str(round(filled_warn[-2][1],3))+" each"
 
 
 
641
  sheet_data[name] = {
642
  "Before columns": [old_olds],
643
  'Sum Before':[sums_old,None,True],
644
  "After columns": [ncols, '00FF00'],
645
  'Sum After':[sums_new,None,True],
 
646
  'Fillings':[filled_warn,None],
647
  "Warnings": sheetwarnings
648
  }
649
-
650
  c_name = name.split('.')[0]+'_cleaned.csv'
651
  df.to_csv(c_name,index=False)
652
 
 
246
  l_missing_df[lob] = l
247
  missing_quarters.append(l_missing_df)
248
 
249
+ filled.append([lobs_dict.keys(),lobs_dict.values()])
250
+ #filled.append("Total paddings (0.1): "+str(missing_count))
251
  print("=="*100)
252
  print('Unique values in', acc, 'for missing quarters:', l_missing_df[acc].unique())
253
  # Concatenate the original dataframe and the missing quarters dataframe
 
636
  if len(filled_warn) == 0:
637
  filled_warn = ['No fillings']
638
  else:
639
+ # tempt_list = [element for element in filled_warn[-2][0] if element in columns]
640
+ # filled_warn[-2] = "Padded columns "+str(list(tempt_list))+" with total of "+str(round(filled_warn[-2][1],3))+" each"
641
+ pass
642
+ fillings_amounts = filled_warn[-1][1]
643
+ filled_warn.pop(-1)
644
  sheet_data[name] = {
645
  "Before columns": [old_olds],
646
  'Sum Before':[sums_old,None,True],
647
  "After columns": [ncols, '00FF00'],
648
  'Sum After':[sums_new,None,True],
649
+ 'Filling amount':[fillings_amounts,None,True]
650
  'Fillings':[filled_warn,None],
651
  "Warnings": sheetwarnings
652
  }
653
+
654
  c_name = name.split('.')[0]+'_cleaned.csv'
655
  df.to_csv(c_name,index=False)
656