Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
PKUJohnson authored and PKUJohnson committed Nov 6, 2018
1 parent a43cd8a commit ee7a887
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion opendatatools/swindex/swindex_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def get_index_cons(self, index_code):
'weight' : weight
})
df = pd.DataFrame(data)
df['start_date'] = df['start_date'].apply(lambda x : datetime.datetime.strptime(x, '%Y/%m/%d %H:%M:%S'))
if len(df) > 0:
df['start_date'] = df['start_date'].apply(lambda x : datetime.datetime.strptime(x, '%Y/%m/%d %H:%M:%S'))
return df, ''

return None, '获取数据失败'
Expand Down

0 comments on commit ee7a887

Please sign in to comment.