-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
教程上的代码运行不起来 #32
Comments
说个解决方案,主要是因为 series = self.func(series, arg) 这一句,以这种方式引用talib.MA函数,将会自动添加一个MovingAverageSeries类参数,导致第一个参数不是是series,因此报错。你可以通过debug查看参数就能明白
#修改后的代码
|
棒!解决了出现的同样问题。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/cedricporter/funcat/blob/master/notebooks/funcat-tutorial.ipynb
中的代码运行到计算均线就出错误了。
如果是 bug 反馈,烦请在 issue 中描述以下问题:
1. funcat 的版本
0.3.2
2. Python 的版本
Python 3.6.5 |Anaconda
3. 是 Windows / Linux / MacOS or others?
linux mint 18.3 amd64
4. 您出现问题对应的源码 / 或者能复现问题的简易代码
$ python
Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.6/site-packages/funcat/func.py", line 31, in init
series = self.func(series, arg)
File "/opt/anaconda3/lib/python3.6/site-packages/talib/init.py", line 24, in wrapper
return func(*args, **kwargs)
File "talib/_func.pxi", line 7863, in talib._ta_lib.MA
TypeError: only size-1 arrays can be converted to Python scalars
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "/opt/anaconda3/lib/python3.6/site-packages/funcat/func.py", line 33, in init
raise FormulaException(e)
funcat.utils.FormulaException: only size-1 arrays can be converted to Python scalars
5. 您出现的错误堆栈日志信息
The text was updated successfully, but these errors were encountered: