From 5d7a334b812a0b5a6214f11e9fdcea46188bb1f3 Mon Sep 17 00:00:00 2001 From: Kevin Johnson Date: Mon, 26 Jul 2021 10:26:52 -0700 Subject: [PATCH] BUG #354 var and stdev ddof --- README.md | 2 +- pandas_ta/statistics/stdev.py | 2 +- pandas_ta/statistics/variance.py | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0edd4085..a817ef12 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ $ pip install pandas_ta Latest Version -------------- -Best choice! Version: *0.3.12b* +Best choice! Version: *0.3.13b* * Includes all fixes and updates between **pypi** and what is covered in this README. ```sh $ pip install -U git+https://github.com/twopirllc/pandas-ta diff --git a/pandas_ta/statistics/stdev.py b/pandas_ta/statistics/stdev.py index 13a8bb67..d5c2ddfa 100644 --- a/pandas_ta/statistics/stdev.py +++ b/pandas_ta/statistics/stdev.py @@ -9,7 +9,7 @@ def stdev(close, length=None, ddof=None, talib=None, offset=None, **kwargs): """Indicator: Standard Deviation""" # Validate Arguments length = int(length) if length and length > 0 else 30 - ddof = int(ddof) if ddof and ddof >= 0 and ddof < length else 1 + ddof = int(ddof) if isinstance(ddof, int) and ddof >= 0 and ddof < length else 1 close = verify_series(close, length) offset = get_offset(offset) mode_tal = bool(talib) if isinstance(talib, bool) else True diff --git a/pandas_ta/statistics/variance.py b/pandas_ta/statistics/variance.py index 66309415..520f7da0 100644 --- a/pandas_ta/statistics/variance.py +++ b/pandas_ta/statistics/variance.py @@ -7,7 +7,7 @@ def variance(close, length=None, ddof=None, talib=None, offset=None, **kwargs): """Indicator: Variance""" # Validate Arguments length = int(length) if length and length > 1 else 30 - ddof = int(ddof) if ddof and ddof >= 0 and ddof < length else 0 + ddof = int(ddof) if isinstance(ddof, int) and ddof >= 0 and ddof < length else 1 min_periods = int(kwargs["min_periods"]) if "min_periods" in kwargs and kwargs["min_periods"] is not None else length close = verify_series(close, max(length, min_periods)) offset = get_offset(offset) diff --git a/setup.py b/setup.py index 110156be..beacf37c 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ "pandas_ta.volatility", "pandas_ta.volume" ], - version=".".join(("0", "3", "12b")), + version=".".join(("0", "3", "13b")), description=long_description, long_description=long_description, author="Kevin Johnson",