def get_lowest(self, code, date,current_date):
'''
??????????
:param code: ????
:param date: ??
:return:
'''
date = date + '-01-01'
cmd = 'select * from `{}` where datetime > \'{}\' and datetime <\'{}\''.format(code, date,current_date)
try:
df = pd.read_sql(cmd, history_engine,index_col='index')
except Exception,e:
print e
return None,None
#print df.dtypes
# ???????????????
if len(df)<1:
return None,None
df['low']=df['low'].astype('float64')
idx= df['low'].idxmin()
min_date= df.loc[idx]
return min_date['datetime'],min_date['low']
评论列表
文章目录