diff --git a/akshare/__init__.py b/akshare/__init__.py index cd624d68795..7a368841442 100644 --- a/akshare/__init__.py +++ b/akshare/__init__.py @@ -2584,9 +2584,10 @@ 1.11.68 fix: fix fund_aum_em interface 1.11.69 add: add futures_gfex_position_rank interface 1.11.70 fix: fix futures_gfex_position_rank interface +1.11.71 fix: fix stock_balance_sheet_by_report_em interface """ -__version__ = "1.11.70" +__version__ = "1.11.71" __author__ = "AKFamily" import sys diff --git a/akshare/futures/cot.py b/akshare/futures/cot.py index 82dbd961b6d..2223f82496b 100644 --- a/akshare/futures/cot.py +++ b/akshare/futures/cot.py @@ -1028,6 +1028,14 @@ def futures_dce_position_rank( def futures_dce_position_rank_other(date: str = "20160104"): + """ + 大连商品交易所-每日持仓排名-具体合约-补充 + http://www.dce.com.cn/dalianshangpin/xqsj/tjsj26/rtj/rcjccpm/index.html + :param date: 交易日 + :type date: str + :return: 合约具体名称列表 + :rtype: list + """ date = cons.convert_date(date) if date is not None else datetime.date.today() if date.strftime("%Y%m%d") not in calendar: warnings.warn("%s非交易日" % date.strftime("%Y%m%d")) @@ -1120,6 +1128,12 @@ def futures_dce_position_rank_other(date: str = "20160104"): def __futures_gfex_vars_list() -> list: + """ + 广州期货交易所-合约品种名称列表 + http://www.gfex.com.cn/gfex/rcjccpm/hqsj_tjsj.shtml + :return: 合约品种名称列表 + :rtype: list + """ url = "http://www.gfex.com.cn/u/interfacesWebVariety/loadList" headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36' @@ -1132,6 +1146,16 @@ def __futures_gfex_vars_list() -> list: def __futures_gfex_contract_list(symbol: str = "si", date: str = "20231113") -> list: + """ + 广州期货交易所-合约具体名称列表 + http://www.gfex.com.cn/gfex/rcjccpm/hqsj_tjsj.shtml + :param symbol: 品种 + :type symbol: str + :param date: 交易日 + :type date: str + :return: 合约具体名称列表 + :rtype: list + """ url = "http://www.gfex.com.cn/u/interfacesWebTiMemberDealPosiQuotes/loadListContract_id" payload = { 'variety': symbol, @@ -1151,6 +1175,18 @@ def __futures_gfex_contract_data( symbol: str = "si", contract_id: str = "si2312", date: str = "20231113") -> pd.DataFrame: + """ + 广州期货交易所-合约具体数据 + http://www.gfex.com.cn/gfex/rcjccpm/hqsj_tjsj.shtml + :param symbol: 品种 + :type symbol: str + :param contract_id: 具体合约 + :type contract_id: str + :param date: 交易日 + :type date: str + :return: 合约具体数据 + :rtype: pandas.DataFrame + """ url = "http://www.gfex.com.cn/u/interfacesWebTiMemberDealPosiQuotes/loadList" payload = { 'trade_date': date, diff --git a/akshare/stock_feature/stock_three_report_em.py b/akshare/stock_feature/stock_three_report_em.py index f81336c3882..ac33c3da649 100644 --- a/akshare/stock_feature/stock_three_report_em.py +++ b/akshare/stock_feature/stock_three_report_em.py @@ -67,7 +67,7 @@ def stock_balance_sheet_by_report_em(symbol: str = "SH600519") -> pd.DataFrame: data_json = r.json() temp_df = pd.DataFrame(data_json["data"]) for col in temp_df.columns: - if temp_df[col].isnull().any(): # 检查列是否包含 None 或 NaN + if temp_df[col].isnull().all(): # 检查列是否包含 None 或 NaN temp_df[col] = pd.to_numeric(temp_df[col], errors='coerce') if big_df.empty: big_df = temp_df @@ -120,7 +120,7 @@ def stock_balance_sheet_by_yearly_em(symbol: str = "SH600036") -> pd.DataFrame: data_json = r.json() temp_df = pd.DataFrame(data_json["data"]) for col in temp_df.columns: - if temp_df[col].isnull().any(): # 检查列是否包含 None 或 NaN + if temp_df[col].isnull().all(): # 检查列是否包含 None 或 NaN temp_df[col] = pd.to_numeric(temp_df[col], errors='coerce') if big_df.empty: big_df = temp_df @@ -166,7 +166,7 @@ def stock_profit_sheet_by_report_em(symbol: str = "SH600519") -> pd.DataFrame: data_json = r.json() temp_df = pd.DataFrame(data_json["data"]) for col in temp_df.columns: - if temp_df[col].isnull().any(): # 检查列是否包含 None 或 NaN + if temp_df[col].isnull().all(): # 检查列是否包含 None 或 NaN temp_df[col] = pd.to_numeric(temp_df[col], errors='coerce') if big_df.empty: big_df = temp_df @@ -212,7 +212,7 @@ def stock_profit_sheet_by_yearly_em(symbol: str = "SH600519") -> pd.DataFrame: data_json = r.json() temp_df = pd.DataFrame(data_json["data"]) for col in temp_df.columns: - if temp_df[col].isnull().any(): # 检查列是否包含 None 或 NaN + if temp_df[col].isnull().all(): # 检查列是否包含 None 或 NaN temp_df[col] = pd.to_numeric(temp_df[col], errors='coerce') if big_df.empty: big_df = temp_df @@ -260,7 +260,7 @@ def stock_profit_sheet_by_quarterly_em( data_json = r.json() temp_df = pd.DataFrame(data_json["data"]) for col in temp_df.columns: - if temp_df[col].isnull().any(): # 检查列是否包含 None 或 NaN + if temp_df[col].isnull().all(): # 检查列是否包含 None 或 NaN temp_df[col] = pd.to_numeric(temp_df[col], errors='coerce') if big_df.empty: big_df = temp_df @@ -308,7 +308,7 @@ def stock_cash_flow_sheet_by_report_em( data_json = r.json() temp_df = pd.DataFrame(data_json["data"]) for col in temp_df.columns: - if temp_df[col].isnull().any(): # 检查列是否包含 None 或 NaN + if temp_df[col].isnull().all(): # 检查列是否包含 None 或 NaN temp_df[col] = pd.to_numeric(temp_df[col], errors='coerce') if big_df.empty: big_df = temp_df @@ -356,7 +356,7 @@ def stock_cash_flow_sheet_by_yearly_em( data_json = r.json() temp_df = pd.DataFrame(data_json["data"]) for col in temp_df.columns: - if temp_df[col].isnull().any(): # 检查列是否包含 None 或 NaN + if temp_df[col].isnull().all(): # 检查列是否包含 None 或 NaN temp_df[col] = pd.to_numeric(temp_df[col], errors='coerce') if big_df.empty: big_df = temp_df @@ -404,7 +404,7 @@ def stock_cash_flow_sheet_by_quarterly_em( data_json = r.json() temp_df = pd.DataFrame(data_json["data"]) for col in temp_df.columns: - if temp_df[col].isnull().any(): # 检查列是否包含 None 或 NaN + if temp_df[col].isnull().all(): # 检查列是否包含 None 或 NaN temp_df[col] = pd.to_numeric(temp_df[col], errors='coerce') if big_df.empty: big_df = temp_df diff --git a/docs/changelog.md b/docs/changelog.md index 82422ccfb88..65bc19fa725 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -70,6 +70,10 @@ ## 更新说明详情 +1.11.71 fix: fix stock_balance_sheet_by_report_em interface + + 1. 修复 stock_balance_sheet_by_report_em 接口 + 1.11.70 fix: fix futures_gfex_position_rank interface 1. 修复 futures_gfex_position_rank 接口 @@ -3125,6 +3129,8 @@ ## 版本更新说明 +1.11.71 fix: fix stock_balance_sheet_by_report_em interface + 1.11.70 fix: fix futures_gfex_position_rank interface 1.11.69 add: add futures_gfex_position_rank interface diff --git a/docs/data/futures/futures.md b/docs/data/futures/futures.md index 3949211c76c..949a258afd0 100644 --- a/docs/data/futures/futures.md +++ b/docs/data/futures/futures.md @@ -1084,7 +1084,7 @@ P.S. 这里仅列出值(pandas.DataFrame)的字段信息 | 名称 | 类型 | 描述 | |-------------------------|--------|---------| -| rank | int64 | 名词 | +| rank | int64 | 名次 | | vol_party_name | object | 会员简称 | | vol | int64 | 成交量 | | vol_chg | int64 | 成交量-增减 | diff --git a/docs/introduction.md b/docs/introduction.md index c561f6184d2..d289b9c4399 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -6,7 +6,7 @@ **风险提示:[AKShare](https://github.com/akfamily/akshare) 开源财经数据接口库所采集的数据皆来自公开的数据源,不涉及任何个人隐私数据和非公开数据。 同时本项目提供的数据接口及相关数据仅用于学术研究,任何个人、机构及团体使用本项目的数据接口及相关数据请注意商业风险。** -1. 本文档更新时间:**2023-11-13**; +1. 本文档更新时间:**2023-11-14**; 2. 如有 [AKShare](https://github.com/akfamily/akshare) 库、文档及数据的相关问题,请在 [AKShare Issues](https://github.com/akfamily/akshare/issues) 中提 Issues; 3. 欢迎关注 **数据科学实战** 微信公众号:
; 4. 如果您的问题未能在文档中找到答案,您也可以加入 **AKShare-VIP QQ 群**: 为了提高问答质量,此群为收费群(一杯咖啡钱即可入群,赠送[《AKShare-初阶-使用教学》](https://zmj.xet.tech/s/wck86)视频课),可以添加 **AKShare-小助手** QQ:1254836886,由小助手邀请入群! ![](https://jfds-1252952517.cos.ap-chengdu.myqcloud.com/akshare/readme/qrcode/qr_code_1254836886.jpg)