mirror of
https://github.com/wassname/pandas-ta.git
synced 2026-06-27 16:10:07 +08:00
ENH #304 convert str to tuple for single col_names
This commit is contained in:
@@ -111,7 +111,7 @@ $ pip install pandas_ta
|
||||
|
||||
Latest Version
|
||||
--------------
|
||||
Best choice! Version: *0.3.00b*
|
||||
Best choice! Version: *0.3.01b*
|
||||
* 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
|
||||
|
||||
@@ -400,6 +400,9 @@ class AnalysisIndicators(BasePandasObject):
|
||||
df = self._df
|
||||
if df is None or result is None: return
|
||||
else:
|
||||
if "col_names" in kwargs and not isinstance(kwargs["col_names"], tuple):
|
||||
kwargs["col_names"] = (kwargs["col_names"],)
|
||||
|
||||
if isinstance(result, pd.DataFrame):
|
||||
# If specified in kwargs, rename the columns.
|
||||
# If not, use the default names.
|
||||
|
||||
@@ -19,7 +19,7 @@ setup(
|
||||
"pandas_ta.volatility",
|
||||
"pandas_ta.volume"
|
||||
],
|
||||
version=".".join(("0", "3", "00b")),
|
||||
version=".".join(("0", "3", "01b")),
|
||||
description=long_description,
|
||||
long_description=long_description,
|
||||
author="Kevin Johnson",
|
||||
|
||||
@@ -253,6 +253,7 @@ class TestStrategyMethods(TestCase):
|
||||
{"kind": "rsi"}, # 1
|
||||
{"kind": "macd"}, # 3
|
||||
{"kind": "sma", "length": 50}, # 1
|
||||
{"kind": "sma", "length": 100, "col_names": "sma100"}, # 1
|
||||
{"kind": "sma", "length": 200 }, # 1
|
||||
{"kind": "bbands", "length": 20}, # 3
|
||||
{"kind": "log_return", "cumulative": True}, # 1
|
||||
|
||||
Reference in New Issue
Block a user