import numpy as np
import pandas as pd
import tushare as ts
from time import sleep
import datetime
# set your tushare.pro token here
token = 'your token'
# get all the stock code
ts.set_token(token)
pro = ts.pro_api()
tscode = '603533.SH'
startData = '20200901'
endData = '202105300'
df = pro.income(ts_code=tscode, start_date=startData, end_date=endData)
df2 =pd.DataFrame(df.values.T, index=df.columns, columns=df.index)
得到的数据首先进行转置处理,然后获取公司基本信息:
#查询当前所有正常上市交易的股票列表
data = pro.query('stock_basic', ts_code=tscode, list_status='L', fields='ts_code,symbol,name,area,industry,list_date')
data
从tushare的官方帮助文档中,获