def CleanDataChenjieAll(self,data,indexs): """处理没有上市股票的异常操作""" time.sleep(1) print data.loc[indexs].values[1] if data.loc[indexs].values[16] == 0:print "this stock don't timeToMarket" else:StockInfo().Get_5_10_20_data(data.loc[indexs].values[1],"2016-11-02","2017-11-24") print "===============%d data finish=================="%(indexs)
def CleanDataPeAll(self,data,indexs): #测试代码 # if data.loc[indexs].values[1][0]=='3' or data.loc[indexs].values[1][0]=='0': # print "===============%d data finish=================="%(indexs) # else: if data.loc[indexs].values[16] == 0:print "this stock don't timeToMarket" else:StockInfo().Get_Pe_data(data.loc[indexs].values[1],'20110101','20171124') print "===============%d data finish=================="%(indexs)
def CleanDataOrgInfoThree(self, data, indexs): try: # code = '300026' code = data.loc[indexs].values[0] print code StockInfo().Get_gnbk(code) print "===============================================" print "=====================%s========================" % (code) print "===============%d data finish==================" % (indexs) except Exception as e: raise e
def JshuanGY(self): data = Mysql().ReadMySql('test4','stock_basics') # data = Mysql().ReadMySql('stock_gainian','shaixuan') pool = ThreadPoolExecutor(max_workers=0)# 创建一个最大可容纳2个task的线程池(开启线程池) futures = [] errcode = [] i=0 for code in data['code']: try: StockInfo().Get_guiyi(code) print "===============%d data finish=================="%(i) i+=1 except: errcode.append(code) print wait(futures) print "=============== data finish=================="
def CleanDataChenjie(self,data,indexs): """处理没有上市股票的异常操作""" if data.loc[indexs].values[16] == 0:print "this stock don't timeToMarket" #else:StockInfo().Get_k_data(data.loc[indexs].values[1],"2015-09-01","2017-10-31") 修改 2017-11-24 bob—jie 修改数据源的长度 else:StockInfo().Get_k_data(data.loc[indexs].values[1],"1984-10-01","2017-11-24") print "===============%d data finish=================="%(indexs)
def CleanDataTradeCal(self): StockInfo().Get_TradeCal_data("19841001","20171124") print "=============== data finish=================="
def StockBasicsData(self): StockInfo().Getstock_basics() print "=============== data finish=================="