yutiansut / QUANTAXIS

QUANTAXIS 支持任务调度 分布式部署的 股票/期货/期权 数据/回测/模拟/交易/可视化/多账户 纯本地量化解决方案
https://yutiansut.github.io/QUANTAXIS/
MIT License
8.19k stars 2.96k forks source link

初始化数据报错 #1805

Open bjccz opened 2 years ago

bjccz commented 2 years ago

QUANTAXIS> save all QUANTAXIS>> Selecting the Best Server IP of TDX USING DEFAULT STOCK IP USING DEFAULT FUTURE IP QUANTAXIS>> === The BEST SERVER === stock_ip 123.125.108.23 future_ip 119.97.185.5 Traceback (most recent call last): File "/opt/conda/bin/quantaxis", line 8, in sys.exit(QA_cmd()) File "/opt/conda/lib/python3.8/site-packages/QUANTAXIS/QACmd/init.py", line 686, in QA_cmd cli.cmdloop() File "/opt/conda/lib/python3.8/cmd.py", line 138, in cmdloop stop = self.onecmd(line) File "/opt/conda/lib/python3.8/cmd.py", line 217, in onecmd return func(arg) File "/opt/conda/lib/python3.8/site-packages/QUANTAXIS/QACmd/init.py", line 350, in do_save QA_SU_save_stock_day('tdx') File "/opt/conda/lib/python3.8/site-packages/QUANTAXIS/QAUtil/init.py", line 169, in wrapper func(*args, kwargs) File "/opt/conda/lib/python3.8/site-packages/QUANTAXIS/QASU/main.py", line 222, in QA_SU_save_stock_day engine.QA_SU_save_stock_day(client=client) File "/opt/conda/lib/python3.8/site-packages/QUANTAXIS/QASU/save_tdx.py", line 196, in QA_SU_save_stock_day stock_list = QA_fetch_get_stock_list().code.unique().tolist() File "/opt/conda/lib/python3.8/site-packages/retrying.py", line 49, in wrapped_f return Retrying(*dargs, *dkw).call(f, args, kw) File "/opt/conda/lib/python3.8/site-packages/retrying.py", line 212, in call raise attempt.get() File "/opt/conda/lib/python3.8/site-packages/retrying.py", line 247, in get six.reraise(self.value[0], self.value[1], self.value[2]) File "/opt/conda/lib/python3.8/site-packages/six.py", line 703, in reraise raise value File "/opt/conda/lib/python3.8/site-packages/retrying.py", line 200, in call attempt = Attempt(fn(*args, kwargs), attempt_number, False) File "/opt/conda/lib/python3.8/site-packages/QUANTAXIS/QAFetch/QATdx.py", line 724, in QA_fetch_get_stock_list return pd.concat([sz, sh], sort=False).query( File "/opt/conda/lib/python3.8/site-packages/pandas/core/frame.py", line 3699, in assign data[k] = com.apply_if_callable(v, data) File "/opt/conda/lib/python3.8/site-packages/pandas/core/frame.py", line 3044, in setitem self._set_item(key, value) File "/opt/conda/lib/python3.8/site-packages/pandas/core/frame.py", line 3120, in _set_item value = self._sanitize_column(key, value) File "/opt/conda/lib/python3.8/site-packages/pandas/core/frame.py", line 3745, in _sanitize_column value = reindexer(value) File "/opt/conda/lib/python3.8/site-packages/pandas/core/frame.py", line 3736, in reindexer raise err File "/opt/conda/lib/python3.8/site-packages/pandas/core/frame.py", line 3731, in reindexer value = value.reindex(self.index)._values File "/opt/conda/lib/python3.8/site-packages/pandas/core/series.py", line 4412, in reindex return super().reindex(index=index, kwargs) File "/opt/conda/lib/python3.8/site-packages/pandas/core/generic.py", line 4463, in reindex return self._reindex_axes( File "/opt/conda/lib/python3.8/site-packages/pandas/core/generic.py", line 4478, in _reindex_axes new_index, indexer = ax.reindex( File "/opt/conda/lib/python3.8/site-packages/pandas/core/indexes/multi.py", line 2319, in reindex raise ValueError("cannot handle a non-unique multi-index!") ValueError: cannot handle a non-unique multi-index!

hellobiek commented 1 year ago

fixed it or not?

frankwang314 commented 1 year ago

I'm encountering the same problem, someone has any ideas?

YifuDeng commented 1 year ago

遇见同样的问题了 解决啦吗

tangul commented 1 year ago

"cannot handle a non-unique multi-index!" 同样遇到这个问题,请问解决了吗

frankwang314 commented 1 year ago

解决了

Tushare内置的pytdx版本和QUANTAXIS使用的pytdx 版本不同, 请重新安装pytdx以解决此问题 pip uninstall pytdx pip install pytdx-1.72r2-py3-none-any.whl

在 2023-05-10 22:41:26,"tangul" @.***> 写道:

"cannot handle a non-unique multi-index!" 同样遇到这个问题,请问解决了吗

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>