Skip to content

Commit

Permalink
Update climdex.py
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvonk committed Jun 9, 2023
1 parent d358b85 commit 7704b14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/spei/climdex.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def cdd(series: Series, threshold: float = 1.0, period: str = "365D") -> Series:

w = series < threshold

return w.diff().rolling(period).sum().astype(int)
return w.diff().rolling(period).sum().dropna().astype(int)


def cwd(series: Series, threshold: float = 1.0, period: str = "365D") -> Series:
Expand All @@ -72,7 +72,7 @@ def cwd(series: Series, threshold: float = 1.0, period: str = "365D") -> Series:

w = series >= threshold

return w.diff().rolling(period).sum().astype(int)
return w.diff().rolling(period).sum().dropna().astype(int)


def prcptot(series: Series, period: str = "1Y") -> Series:
Expand Down

0 comments on commit 7704b14

Please sign in to comment.