waditu / tushare

TuShare is a utility for crawling historical data of China stocks
BSD 3-Clause "New" or "Revised" License
12.8k stars 4.29k forks source link

fund_holdings 函数使用的两个问题 #1415

Open walkingsky opened 4 years ago

walkingsky commented 4 years ago

使用日期 2020年8月份

`import tushare as ts

df = ts.fund_holdings(2020,1)

df.to_csv('1.csv') `

  1. fund_holdings(2020,1) ,返回了60条数据。 远远小于 fund_holdings(2020,2) 返回的1298条数据
  2. fund_holdings(2020,2) 返回的数据中,有代码重复的数据,(2个3条数据的代码(2601,921),12个2条数据重复的代码),有些是和基金代码重复了。3个的就不知道是啥了。

tushareID: 385980

walkingsky commented 4 years ago

研究了下,

  1. fund_holdings(2020,1) 163网站返回的 pagecount 是 null ,所以程序没有继续取下一页
  2. 数据的问题,从接口里直接获取到的数据就是这样重复的

从其他网站上撸了个这个url,获取的数据信息要稳定些

url 如下,还没研究各个参数的意义

http://datainterface3.eastmoney.com/EM_DataCenter_V3/api/JJSJTJ/GetJJSJTJ?tkn=eastmoney&ReportDate=2020-03-31&code=&type=1&zjc=0&sortField=Count&sortDirec=1&pageNum=1&pageSize=1650&cfg=jjsjtj