waditu / tushare

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

LPR数据错误 #1749

Open ZhongHaoAustin opened 3 months ago

ZhongHaoAustin commented 3 months ago

复现代码

# %%
# 拉取数据
import tushare as ts

# 初始化pro接口
pro = ts.pro_api()
df = pro.shibor_lpr(
    **{"date": "", "start_date": 20200702, "end_date": 20240928, "limit": "", "offset": ""},
    fields=["date", "1y", "5y"]
)
print(df)

date列第 8 行格式与其他不一致

          date    1y    5y
0     20240820  3.35  3.85
1     20240722  3.35  3.85
2     20240620  3.45  3.95
3     20240520  3.45  3.95
4     20240422  3.45  3.95
5     20240320  3.45  3.95
6     20240220  3.45  3.95
7     20240122  3.45  4.20
8   2024-08-20  3.35  3.85
9     20231220  3.45  4.20
10    20231120  3.45  4.20
11    20231020  3.45  4.20
12    20230920  3.45  4.20
13    20230821  3.45  4.20
14    20230720  3.55  4.20
15    20230620  3.55  4.20
16    20230522  3.65  4.30
17    20230420  3.65  4.30
18    20230320  3.65  4.30
19    20230220  3.65  4.30
20    20230120  3.65  4.30
21    20221220  3.65  4.30
22    20221121  3.65  4.30
23    20221020  3.65  4.30
...
47    20201020  3.85  4.65
48    20200921  3.85  4.65
49    20200820  3.85  4.65
50    20200720  3.85  4.65