Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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: ['
|
| 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 [
|
| 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:
|