mirror of
https://github.com/wassname/pandas-ta.git
synced 2026-06-27 16:10:07 +08:00
BUG #354 var and stdev ddof
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user