Skip to content

Commit

Permalink
[MNT] address pandas astype deprecation in TrendForecaster (#4032)
Browse files Browse the repository at this point in the history
Addresses a `pandas` deprecation warning from `TrendForecaster`.

Warning addressed is the following one:

```
FutureWarning: The behavior of .astype from datetime64[ns] to int32 is
deprecated. In a future version, this astype will return exactly the specified dtype
instead of int64, and will raise if that conversion overflows.
```
  • Loading branch information
fkiraly authored Jan 10, 2023
1 parent 9773395 commit c2eb974
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sktime/forecasting/trend.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def _fit(self, y, X=None, fh=None):
self.regressor_ = clone(self.regressor)

# transform data
X = y.index.astype("int").to_numpy().reshape(-1, 1)
X = y.index.astype("int64").to_numpy().reshape(-1, 1)

# fit regressor
self.regressor_.fit(X, y)
Expand Down

0 comments on commit c2eb974

Please sign in to comment.