Skip to content
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

zh_get_daily.py 报错 #7

Open
onlytiancai opened this issue Nov 7, 2020 · 1 comment
Open

zh_get_daily.py 报错 #7

onlytiancai opened this issue Nov 7, 2020 · 1 comment

Comments

@onlytiancai
Copy link

$ python3.6 task/zh_get_daily.py
清空表数据:
TRUNCATE TABLE zh_stocks_d;

processing [1/4056] : 000001.SZ
Traceback (most recent call last):
File "task/zh_get_daily.py", line 59, in
df = analysis.stock_zh_analysis(df, 20, 60, 120)
File "task/../tools/util/analysis.py", line 164, in stock_zh_analysis
data = stock_gap_and_over(data)
File "task/../tools/util/analysis.py", line 91, in stock_gap_and_over
axis=1, raw=True)
File "/home/wawa/.local/lib/python3.6/site-packages/pandas/core/frame.py", line 7552, in apply
return op.get_result()
File "/home/wawa/.local/lib/python3.6/site-packages/pandas/core/apply.py", line 178, in get_result
return self.apply_raw()
File "/home/wawa/.local/lib/python3.6/site-packages/pandas/core/apply.py", line 235, in apply_raw
result = np.apply_along_axis(wrap_function(self.f), self.axis, self.values)
File "<array_function internals>", line 6, in apply_along_axis
File "/home/wawa/.local/lib/python3.6/site-packages/numpy/lib/shape_base.py", line 379, in apply_along_axis
res = asanyarray(func1d(inarr_view[ind0], *args, **kwargs))
File "/home/wawa/.local/lib/python3.6/site-packages/pandas/core/apply.py", line 228, in wrapper
result = func(*args, **kwargs)
File "task/../tools/util/analysis.py", line 90, in
lambda row: is_gap(row['high'], row['low'], row['close'], row['pre_high'], row['pre_low'], row['pre_close']),
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

@hk-Lei
Copy link
Collaborator

hk-Lei commented Nov 8, 2020

pandas 的版本使用 0.25.3 试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants