diff --git a/akshare/futures/futures_index_ccidx.py b/akshare/futures/futures_index_ccidx.py index 873fc38d193..4a4dc8f0773 100644 --- a/akshare/futures/futures_index_ccidx.py +++ b/akshare/futures/futures_index_ccidx.py @@ -5,6 +5,7 @@ Desc: 中证商品指数 http://www.ccidx.com/ """ + from io import BytesIO import pandas as pd @@ -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 @@ -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 @@ -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) diff --git a/docs/introduction.md b/docs/introduction.md index 0f1b4ce5fdd..4b2e8883a6c 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -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. 欢迎关注 **数据科学实战** 微信公众号;
4. **知识星球【数据科学实战】** 2024 全新改版,聚焦于量化投资内容,欢迎加入 **知识星球【数据科学实战】** 高质量社区,里面有丰富的视频课程、问答、文章、书籍及代码等内容: