XPMaster commited on
Commit
1543c02
·
1 Parent(s): 479e4dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -208,7 +208,7 @@ def fill_missing_quarters(df, lob, acc, transaction):
208
  l_df = df[df[lob] == l]
209
  l_quarters = set(quarters) - set(l_df[acc])
210
  l_missing_df = pd.DataFrame({acc: list(l_quarters),
211
- transaction: ['202212'] * len(l_quarters)})
212
  for col in df.columns: # Fill the missing
213
  if col != lob: # These two checks are nesscary in case we are filling for the premium then we only fill it with the missing quarters without the 202212 for transactions
214
  if col == acc:
@@ -232,7 +232,7 @@ def fill_missing_quarters(df, lob, acc, transaction):
232
  filled_df = filled_df.reset_index(drop=True)
233
  # Print the filled quarters or a message if there are no missing quarters
234
  filled_quarters = filled_df[acc].unique()
235
- filtered_quarters = [q for q in filled_quarters if q[:4] in ['2017', '2018', '2019', '2020', '2021', '2022']]
236
  if len(filtered_quarters) == 0:
237
  print("No missing quarters between 2017-2022")
238
  else:
 
208
  l_df = df[df[lob] == l]
209
  l_quarters = set(quarters) - set(l_df[acc])
210
  l_missing_df = pd.DataFrame({acc: list(l_quarters),
211
+ transaction: [str(end_year)+'12'] * len(l_quarters)})
212
  for col in df.columns: # Fill the missing
213
  if col != lob: # These two checks are nesscary in case we are filling for the premium then we only fill it with the missing quarters without the 202212 for transactions
214
  if col == acc:
 
232
  filled_df = filled_df.reset_index(drop=True)
233
  # Print the filled quarters or a message if there are no missing quarters
234
  filled_quarters = filled_df[acc].unique()
235
+ filtered_quarters = [q for q in filled_quarters if q[:4] in [str(year1) for year1 in range(start_year, end_year + 1)]]
236
  if len(filtered_quarters) == 0:
237
  print("No missing quarters between 2017-2022")
238
  else: