Upgrade pandas
Also, replace the deprecated "T" frequency alias with "min", and access the trend by position with `.iloc`.
This commit is contained in:
parent
6290d280e2
commit
705955b38b
2 changed files with 105 additions and 85 deletions
|
|
@ -50,8 +50,8 @@ def predict(
|
|||
|
||||
# Create a point forecast by linear extrapolation
|
||||
# for one or even more time steps ahead.
|
||||
slope = trend[-1] - trend[-2]
|
||||
prediction = trend[-1] + slope
|
||||
slope = trend.iloc[-1] - trend.iloc[-2]
|
||||
prediction = trend.iloc[-1] + slope
|
||||
idx = observations.index.max() + seasonal_lag
|
||||
while idx <= forecast_interval.max():
|
||||
if idx in forecast_interval:
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ class OrderHistory:
|
|||
gen = (
|
||||
(pixel_id, start_at)
|
||||
for pixel_id in sorted(data.index.levels[0])
|
||||
for start_at in pd.date_range(start, end, freq=f'{self._time_step}T')
|
||||
for start_at in pd.date_range(start, end, freq=f'{self._time_step}min')
|
||||
if config.SERVICE_START <= start_at.hour < config.SERVICE_END
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue