From e5135d408c95a3ba5918b6c1a1163c81f23bfd62 Mon Sep 17 00:00:00 2001 From: Oshan Date: Tue, 18 Jun 2024 20:42:33 +0530 Subject: [PATCH] update for deprecated pandas attributes. dt.week has been deprecated in favor of dt.isocalendar().week. --- standard_precip/base_sp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard_precip/base_sp.py b/standard_precip/base_sp.py index 3559db9..cf06dfd 100644 --- a/standard_precip/base_sp.py +++ b/standard_precip/base_sp.py @@ -213,7 +213,7 @@ def calculate(self, df: pd.DataFrame, date_col: str, precip_cols: list, freq: st if freq == "D": self._df_copy[self.freq_col] = self._df_copy[date_col].dt.dayofyear elif freq == "W": - self._df_copy[self.freq_col] = self._df_copy[date_col].dt.week + self._df_copy[self.freq_col] = self._df_copy[date_col].dt.isocalendar().week elif freq == "M": self._df_copy[self.freq_col] = self._df_copy[date_col].dt.month else: