Skip to content

Commit

Permalink
👔 Add additional month columns and "0" columns
Browse files Browse the repository at this point in the history
  • Loading branch information
jh0ker committed Nov 13, 2023
1 parent cf6a688 commit a08d05f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ddj_cloud/scrapers/talsperren/exporters/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _add_daily_fill_percent_to_map(

# Add a new column to `df_map` for each of the last 7 days
today_midnight = local_today_midnight()
for days_offset in range(1, 8):
for days_offset in range(0, 8):
# Use Python to calculate the timestamp for correct timezone support, then convert to pandas
ts = today_midnight - dt.timedelta(days=days_offset)
ts = pd.Timestamp(ts)
Expand Down Expand Up @@ -92,7 +92,7 @@ def _add_monthly_fill_percent_to_map(
# Add a new column to `df_map` for each of the last 6 months
today_midnight = local_today_midnight()
current_month = today_midnight.replace(day=1)
for months_offset in range(1, 6):
for months_offset in range(0, 13):
ts = current_month - relativedelta(months=months_offset, days=1)
ts = pd.Timestamp(ts)
df_month = df_monthly.loc[(slice(None), ts), :].reset_index(level=1, drop=True)
Expand Down

0 comments on commit a08d05f

Please sign in to comment.