ENH #304 convert str to tuple for single col_names

This commit is contained in:
Kevin Johnson
2021-06-30 12:41:12 -07:00
parent 0c08b7f6b8
commit 42e71ef5e1
4 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -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
+3
View File
@@ -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.
+1 -1
View File
@@ -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",
+1
View File
@@ -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