Skip to content

Commit

Permalink
Fix pandas resample API change for base kwarg
Browse files Browse the repository at this point in the history
The "base" kwarg is no longer valid for resample in pandas.
See pandas-dev/pandas#31809
  • Loading branch information
mps01060 committed Feb 5, 2024
1 parent 6da36c8 commit 82aafad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions intense/qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ def check_hourly_neighbours(self) -> Tuple[List[int], List[int]]:
df = self.gauge.data.to_frame("target")

# convert hourly to daily 7am-7am
daily_values = df.target.resample('24H', base=7, closed='right').sum(min_count=24).round(1)
daily_values = df.target.resample('24h', offset='7h', closed='right').sum(min_count=24).round(1)
daily_values.index = daily_values.index.date

neighbours, paths = self.find_neighbours('hourly')
Expand Down Expand Up @@ -986,7 +986,7 @@ def check_daily_neighbours(self) -> Tuple[List[int], int, float, float, float, L
df = self.gauge.data.to_frame("target")

# convert hourly to daily 7am-7am
daily_values = df.target.resample('24H', base=7, closed='right').sum(min_count=24).round(1)
daily_values = df.target.resample('24h', offset='7h', closed='right').sum(min_count=24).round(1)
daily_values.index = daily_values.index.date

# offset by one day in either direction to help identify optimum offset
Expand Down

0 comments on commit 82aafad

Please sign in to comment.