dmarr commited on
Commit
0f41898
·
1 Parent(s): 82cce9f
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -432,17 +432,16 @@ def run_app():
432
  # Create a Table that displays the forecast of each dataframe total for two months before date and two months after
433
  # Filter dates for two months before and after the current date
434
  # Define date ranges
435
-
436
- ## I am under the impression that I will need to use past_date for the offset
437
  # two_months_before = (current_date - pd.DateOffset(months=2)).strftime('%Y-%m')
438
  # one_month_before = (current_date - pd.DateOffset(months=1)).strftime('%Y-%m')
439
  # one_month_after = (current_date + pd.DateOffset(months=1)).strftime('%Y-%m')
440
  # two_months_after = (current_date + pd.DateOffset(months=2)).strftime('%Y-%m')
441
 
442
- two_months_before = (past_date - pd.DateOffset(months=2)).strftime('%Y-%m')
443
- one_month_before = (past_date - pd.DateOffset(months=1)).strftime('%Y-%m')
444
- one_month_after = (past_date + pd.DateOffset(months=1)).strftime('%Y-%m')
445
- two_months_after = (past_date + pd.DateOffset(months=2)).strftime('%Y-%m')
446
 
447
  # Assuming df is the DataFrame containing the date index and the 'Total' column
448
 
@@ -486,7 +485,7 @@ def run_app():
486
  df_photo_date_filtered = monthly_average_photo_date[
487
  (monthly_average_photo_date.index == two_months_before) |
488
  (monthly_average_photo_date.index == one_month_before) |
489
- (monthly_average_photo_date.index == past_date.strftime('%Y-%m')) |
490
  (monthly_average_photo_date.index == one_month_after) |
491
  (monthly_average_photo_date.index == two_months_after)
492
  ]
@@ -508,7 +507,7 @@ def run_app():
508
 
509
  # Create a DataFrame for display
510
  data_avg_expected_normal = {
511
- 'Dates': [two_months_before, one_month_before, past_date.strftime('%Y-%m'), one_month_after, two_months_after],
512
  f"Forecast update {current_date_str}": current_forecast_update,
513
  f"Forecast update {past_date_str}": past_forecast_update,
514
  'Delta': delta
 
432
  # Create a Table that displays the forecast of each dataframe total for two months before date and two months after
433
  # Filter dates for two months before and after the current date
434
  # Define date ranges
435
+ # I am under the impression that I will need to use past_date for the offset
 
436
  # two_months_before = (current_date - pd.DateOffset(months=2)).strftime('%Y-%m')
437
  # one_month_before = (current_date - pd.DateOffset(months=1)).strftime('%Y-%m')
438
  # one_month_after = (current_date + pd.DateOffset(months=1)).strftime('%Y-%m')
439
  # two_months_after = (current_date + pd.DateOffset(months=2)).strftime('%Y-%m')
440
 
441
+ two_months_before = (current_date - pd.DateOffset(months=2)).strftime('%Y-%m')
442
+ one_month_before = (current_date - pd.DateOffset(months=1)).strftime('%Y-%m')
443
+ one_month_after = (current_date + pd.DateOffset(months=1)).strftime('%Y-%m')
444
+ two_months_after = (current_date + pd.DateOffset(months=2)).strftime('%Y-%m')
445
 
446
  # Assuming df is the DataFrame containing the date index and the 'Total' column
447
 
 
485
  df_photo_date_filtered = monthly_average_photo_date[
486
  (monthly_average_photo_date.index == two_months_before) |
487
  (monthly_average_photo_date.index == one_month_before) |
488
+ (monthly_average_photo_date.index == current_date.strftime('%Y-%m')) |
489
  (monthly_average_photo_date.index == one_month_after) |
490
  (monthly_average_photo_date.index == two_months_after)
491
  ]
 
507
 
508
  # Create a DataFrame for display
509
  data_avg_expected_normal = {
510
+ 'Dates': [two_months_before, one_month_before, current_date.strftime('%Y-%m'), one_month_after, two_months_after],
511
  f"Forecast update {current_date_str}": current_forecast_update,
512
  f"Forecast update {past_date_str}": past_forecast_update,
513
  'Delta': delta