diff --git a/nbs/preprocessing.ipynb b/nbs/preprocessing.ipynb index 79185af..91af9d5 100644 --- a/nbs/preprocessing.ipynb +++ b/nbs/preprocessing.ipynb @@ -183,15 +183,17 @@ " # minutes are represented as 'm' in numpy\n", " freq = 'm'\n", " elif isinstance(offset.base, pd.offsets.BusinessDay):\n", - " if offset.n != 1:\n", + " if n != 1:\n", " raise NotImplementedError('Multiple of a business day')\n", " freq = 'D'\n", " elif isinstance(offset.base, pd.offsets.Hour):\n", " # hours are represented as 'h' in numpy\n", " freq = 'h'\n", " elif isinstance(offset.base, (pd.offsets.QuarterBegin, pd.offsets.QuarterEnd)):\n", - " n *= 3\n", + " n = 3\n", " freq = 'M'\n", + " elif isinstance(offset.base, (pd.offsets.YearBegin, pd.offsets.YearEnd)):\n", + " freq = 'Y'\n", " if n > 1:\n", " freq = freq.replace(str(n), '')\n", " try:\n", diff --git a/settings.ini b/settings.ini index 3dd7fae..e6f4d03 100644 --- a/settings.ini +++ b/settings.ini @@ -1,7 +1,7 @@ [DEFAULT] repo = utilsforecast lib_name = utilsforecast -version = 0.1.6 +version = 0.1.7 min_python = 3.8 license = apache2 black_formatting = True diff --git a/utilsforecast/__init__.py b/utilsforecast/__init__.py index 0a8da88..f1380ee 100644 --- a/utilsforecast/__init__.py +++ b/utilsforecast/__init__.py @@ -1 +1 @@ -__version__ = "0.1.6" +__version__ = "0.1.7" diff --git a/utilsforecast/preprocessing.py b/utilsforecast/preprocessing.py index f864042..0ff1d2c 100644 --- a/utilsforecast/preprocessing.py +++ b/utilsforecast/preprocessing.py @@ -129,15 +129,17 @@ def fill_gaps( # minutes are represented as 'm' in numpy freq = "m" elif isinstance(offset.base, pd.offsets.BusinessDay): - if offset.n != 1: + if n != 1: raise NotImplementedError("Multiple of a business day") freq = "D" elif isinstance(offset.base, pd.offsets.Hour): # hours are represented as 'h' in numpy freq = "h" elif isinstance(offset.base, (pd.offsets.QuarterBegin, pd.offsets.QuarterEnd)): - n *= 3 + n = 3 freq = "M" + elif isinstance(offset.base, (pd.offsets.YearBegin, pd.offsets.YearEnd)): + freq = "Y" if n > 1: freq = freq.replace(str(n), "") try: