tushare.pro_api()有什么作用
时间: 2023-12-14 21:37:03 浏览: 335
`tushare.pro_api()` 是 Tushare 库中的一个函数,它的作用是创建一个 Tushare 的 Pro 版本 API 接口对象,可以用该对象来调用 Tushare 提供的各种金融市场数据查询接口。调用该函数需要提供 Tushare 的 Pro 版本的 token(可以在 Tushare 官网上免费注册获得),例如:
```python
import tushare as ts
token = 'your_token_here'
pro = ts.pro_api(token)
```
接下来就可以使用 `pro` 对象调用 Tushare 提供的各种金融市场数据查询接口了,例如:
```python
df = pro.stock_basic(exchange='', list_status='L', fields='ts_code,symbol,name,area,industry,list_date')
```
该接口用于获取 A 股所有股票列表信息,返回一个 pandas.DataFrame 对象。
阅读全文
相关推荐








