# Python基本设置
#导入常用模块
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from datetime import *
%matplotlib inline
#设置绘图参数(中文显示以及坐标轴负数显示)
plt.rcParams['font.sans-serif'] = ['Simhei'] #解决中文显示问题,黑体
plt.rcParams['axes.unicode_minus'] = False #解决负数坐标显示问题
# 导入Tushare模块
import tushare as ts
ts.set_token('your token') # 详见tushare API
pro = ts.pro_api()
# 获取数据
# 定义获取创业板涨跌数据的函数
def get_cyb_chg(date="20200515"):
data = pro.query(
'stock_basic',
exchange='',
list_status='L',
fields=
'ts_code,symbol,name,area,industry,fullname,enname,market,exchange,curr_type,list_status,list_date,delist_date,is_hs',
trade_date=date)