diff --git a/CHANGELOG.md b/CHANGELOG.md index fbada67d4..25bb8573d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Set default value of `TSDataset.head` method ([#170](https://github.com/tinkoff-ai/etna-ts/pull/170)) +- Categorical and fillna issues with pandas >=1.2 ([#190](https://github.com/tinkoff-ai/etna-ts/pull/190)) ## [1.1.3] - 2021-10-08 ### Fixed diff --git a/etna/transforms/pytorch_forecasting.py b/etna/transforms/pytorch_forecasting.py index adccf5d79..4639923aa 100644 --- a/etna/transforms/pytorch_forecasting.py +++ b/etna/transforms/pytorch_forecasting.py @@ -172,7 +172,7 @@ def transform(self, df: pd.DataFrame) -> pd.DataFrame: ts = TSDataset(df, self.freq) df_flat = ts.to_pandas(flatten=True) df_flat = df_flat[df_flat.timestamp >= self.min_timestamp] - df_flat = df_flat.fillna(0) + df_flat["target"] = df_flat["target"].fillna(0) freq_unit = self._calculate_freq_unit(self.freq) df_flat["time_idx"] = (df_flat["timestamp"] - self.min_timestamp) / freq_unit