Skip to content

AKShare 接口问题报告:stock_sector_fund_flow_rank 获取资金流时无法处理数据为空的情况 #7303

Description

@hanlv15

AKShare 版本:1.18.64
系统版本:Ubuntu 22.04.4 LTS
Python 版本:3.11.15
调用方式:df = ak.stock_sector_fund_flow_rank(indicator="今日", sector_type=’概念资金流‘)
接口报错的截图或描述:
❌ 处理 概念资金流 数据时出错: ("Could not convert '-' with type str: tried to convert to double", 'Conversion failed for column 今日主力净流入-净占比 with type object')

原因是当天有新的板块出现,导致返回的数据为空,希望能够优雅地处理这种情况:
... (省略)
-,-,BK1710,先进制造风格,-,-,-,-,-,-,-,-,-,1780588800,-,-,-,-
-,-,BK1711,消费风格,-,-,-,-,-,-,-,-,-,1780588800,-,-,-,-
-,-,BK1712,医药医疗风格,-,-,-,-,-,-,-,-,-,1780588800,-,-,-,-
-,-,BK1713,科技风格,-,-,-,-,-,-,-,-,-,1780588800,-,-,-,-
-,-,BK1714,金融地产风格,-,-,-,-,-,-,-,-,-,1780588800,-,-,-,-
-,-,BK1715,趋势股,-,-,-,-,-,-,-,-,-,1780588800,-,-,-,-
-,-,BK1716,反转股,-,-,-,-,-,-,-,-,-,1780588800,-,-,-,-
-,-,BK1717,题材股,-,-,-,-,-,-,-,-,-,1780588800,-,-,-,-

期望获得的正确结果:可以考虑忽略这些数据为空的板块,从而避免报错

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions