Skip to content

Commit

Permalink
fix: tool_trade_date_hist_sina
Browse files Browse the repository at this point in the history
  • Loading branch information
albertandking committed Mar 25, 2024
1 parent f5c6215 commit 6f5805f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions akshare/tool/trade_date_hist.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2023/12/27 22:27
Date: 2024/3/25 16:30
Desc: 新浪财经-交易日历
https://finance.sina.com.cn/realstock/company/klc_td_sh.txt
此处可以用来更新 calendar.json 文件,注意末尾没有 "," 号
"""

import datetime

import pandas as pd
Expand All @@ -32,7 +33,7 @@ def tool_trade_date_hist_sina() -> pd.DataFrame:
temp_df["trade_date"] = pd.to_datetime(temp_df["trade_date"]).dt.date
temp_list = temp_df["trade_date"].to_list()
# 该日期是交易日,但是在新浪返回的交易日历缺失该日期,这里补充上
temp_list.append(datetime.date(1992, 5, 4))
temp_list.append(datetime.date(year=1992, month=5, day=4))
temp_list.sort()
temp_df = pd.DataFrame(temp_list, columns=["trade_date"])
return temp_df
Expand Down
2 changes: 1 addition & 1 deletion docs/data/tool/tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

接口: tool_trade_date_hist_sina

目标地址: https://finance.sina.com.cn/realstock/company/klc_td_sh.txt
目标地址: https://finance.sina.com.cn

描述: 新浪财经-股票交易日历数据

Expand Down

0 comments on commit 6f5805f

Please sign in to comment.