Skip to content

Commit

Permalink
get_k_data bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmysoa committed Nov 9, 2016
1 parent 6b5836b commit 6f00eae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tushare/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.5.7'
__version__ = '0.5.8'
__author__ = 'Jimmy Liu'

"""
Expand Down
3 changes: 1 addition & 2 deletions tushare/stock/trading.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,7 @@ def get_k_data(code=None, start='', end='',
reg = re.compile(r',{"nd.*?}')
lines = re.subn(reg, '', lines)
js = json.loads(lines[0])
keystr = list(js['data'][symbol].keys())[2]
dataflag = keystr if keystr in ct.FQ_KEY else dataflag
dataflag = dataflag if dataflag in list(js['data'][symbol].keys()) else ct.TT_K_TYPE[ktype.upper()]
df = pd.DataFrame(js['data'][symbol][dataflag], columns=ct.KLINE_TT_COLS)
df['code'] = symbol if index else code
if ktype in ct.K_MIN_LABELS:
Expand Down

0 comments on commit 6f00eae

Please sign in to comment.