新建Python环境后pd.DataFrame.from_dict报vhstack_dispatcher参数缺失错误
解决pd.DataFrame.from_dict报错vhstack_dispatcher()缺少dtype和casting参数的问题
- 背景:一直使用
pd.DataFrame.from_dict从JSON字典生成DataFrame,此前代码运行正常。为升级OSMnx包,按官方文档删除原有环境并新建环境后,运行代码触发错误。 - 错误提示:
vhstack_dispatcher() missing 2 required keyword-only arguments: 'dtype' and 'casting' - 涉事代码片段:
path = r'...\file.json' json_file = open(path) raw_data=json.load(json_file) df=pd.DataFrame.from_dict(raw_data, dtype=None)
- 解决方式:再次删除并重新创建环境后,问题解决,代码恢复正常运行。
内容的提问来源于stack exchange,提问作者Beatriz Santos
相关产品推荐
相关产品推荐

