Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #5458

Merged
merged 2 commits into from
Dec 24, 2024
Merged

Dev #5458

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions akshare/futures/futures_index_ccidx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Desc: 中证商品指数
http://www.ccidx.com/
"""

from io import BytesIO

import pandas as pd
Expand Down Expand Up @@ -51,7 +52,7 @@ def futures_index_ccidx(symbol: str = "中证商品期货指数") -> pd.DataFram
temp_df["结算"] = pd.to_numeric(temp_df["结算"], errors="coerce")
temp_df["涨跌"] = pd.to_numeric(temp_df["涨跌"], errors="coerce")
temp_df["涨跌幅"] = pd.to_numeric(temp_df["涨跌幅"], errors="coerce")
temp_df.sort_values(by=['日期'], inplace=True)
temp_df.sort_values(by=["日期"], inplace=True)
temp_df.reset_index(inplace=True, drop=True)
return temp_df

Expand All @@ -60,7 +61,8 @@ def futures_index_min_ccidx(symbol: str = "中证监控油脂油料期货指数"
"""
中证商品指数-商品指数-分时数据
http://www.ccidx.com/index.html
:param symbol: choice of {"中证商品期货指数", "中证商品期货价格指数", "中证监控油脂油料期货指数", "中证监控软商品期货指数", "中证监控能化期货指数", "中证监控钢铁期货指数"}
:param symbol: choice of {"中证商品期货指数", "中证商品期货价格指数", "中证监控油脂油料期货指数", "中证监控软商品期货指数",
"中证监控能化期货指数", "中证监控钢铁期货指数"}
:type symbol: str
:return: 商品指数-分时数据
:rtype: pandas.DataFrame
Expand Down Expand Up @@ -93,7 +95,8 @@ def futures_index_min_ccidx(symbol: str = "中证监控油脂油料期货指数"
"Pragma": "no-cache",
"Proxy-Connection": "keep-alive",
"Referer": "http://www.ccidx.com/cscidx/quote1",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/92.0.4515.159 Safari/537.36",
"X-Requested-With": "XMLHttpRequest",
}
r = requests.post(url, params=params, data=payload, headers=headers)
Expand Down
2 changes: 1 addition & 1 deletion docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
**风险提示**:[AKShare](https://github.com/akfamily/akshare) 开源财经数据接口库所采集的数据皆来自公开的数据源,不涉及任何个人隐私数据和非公开数据。
同时本项目提供的数据接口及相关数据仅用于学术研究,任何个人、机构及团体使用本项目的数据接口及相关数据请注意商业风险。

1. 本文档更新时间:**2024-12-23**;
1. 本文档更新时间:**2024-12-24**;
2. 如有 [AKShare](https://github.com/akfamily/akshare) 库、文档及数据的相关问题,请在 [AKShare Issues](https://github.com/akfamily/akshare/issues) 中提 Issues;
3. 欢迎关注 **数据科学实战** 微信公众号;<div><img src="https://jfds-1252952517.cos.ap-chengdu.myqcloud.com/akshare/readme/qrcode/ds.png"></div>
4. **知识星球【数据科学实战】** 2024 全新改版,聚焦于量化投资内容,欢迎加入 **知识星球【数据科学实战】** 高质量社区,里面有丰富的视频课程、问答、文章、书籍及代码等内容:
Expand Down
Loading