quantOS-org / JAQS

http://www.quantos.org/jaqs/
Other
619 stars 343 forks source link

最新 master DataView 问题: #27

Open gaizoule opened 6 years ago

gaizoule commented 6 years ago

from jaqs.data.dataservice import RemoteDataService from jaqs.data.dataview import DataView import json

ds = RemoteDataService()

with open('./data_config.json', 'r') as f: data_config = json.load(f) ds.init_from_config(data_config)

dv = DataView() secs = '600030.SH,000063.SZ,000001.SZ' props = {'start_date': 20070406, 'end_date': 20180309, 'symbol': secs, 'fields': 'open,close,high,low,volume,pb,net_assets,eps_basic', 'freq': 1} dv.init_from_config(props, data_api=ds) dv.prepare_data() snap1 = dv.get_snapshot(20170504, symbol='600030.SH,000063.SZ', fields='close,pb')

报错:

In [13]: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last)

in () ----> 1 snap1 = dv.get_snapshot(20170504, symbol='600030.SH,000063.SZ', fields='close,pb') ~/anaconda3/lib/python3.6/site-packages/jaqs-0.6.9.4-py3.6.egg/jaqs/data/dataview.py in get_snapshot(self, snapshot_date, symbol, fields) 1120 # df = self.data_d.T.unstack() 1121 # df = df[snapshot_date].copy() -> 1122 if snapshot_date not in self._snapshot: 1123 return 1124 AttributeError: 'DataView' object has no attribute '_snapshot' 查了一下,是两天前的改动出的问题。