我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用tushare.get_industry_classified()。
def load_tushare_df(df_type): file = 'ts.' + df_type + '.dat' try: obj = pickle.load(open(file,"rb")) except: #print("---load in the fly",df_type) if df_type == "basic": obj = ts.get_stock_basics() elif df_type == "sme": obj = ts.get_sme_classified() elif df_type == "gem": obj=ts.get_gem_classified() elif df_type == "industry": #print(ts, pickle) obj = ts.get_industry_classified() #?????,??2800??,?????3326,??????? get_stock_basics elif df_type == "st": obj = ts.get_st_classified() else: raise Exception("Error TSshare Type!!!") pickle.dump(obj,open(file,"wb",0)) else: #print("***Read from file %s" % df_type) pass return obj
def plot_days(): if request.method == 'GET' : today = ts.get_today_all() code_info = ts.get_industry_classified() today['code'] = today['code'].astype(unicode) one_day = gd.get_data_real_time(code_info, today) body = heatmap.get_heatmap('Today', one_day) return render_template('heatmap.html', body=body)