英文:
AttributeError: module 'pandas.core.strings' has no attribute 'StringMethods' when importing Dask
问题
我在尝试导入dask.dataframe接口时,即使import dask可以工作,仍然出现了问题标题中所述的错误。
我的当前版本是2022.7.0。可能的问题是什么?
英文:
I am getting the error stated in the question title when trying to import dask.dataframe interface, even though import dask works.
My current version of dask is 2022.7.0. What might be the problem?
答案1
得分: 9
问题出在Pandas和Dask之间的版本兼容性问题上。StringMethods 是Pandas的字符串处理功能的一部分,Dask DataFrames 也使用它。
然而,我不知道这个属性在较旧版本的Pandas中不可用。
我更新了这两个库,错误消失了:
pip install --upgrade pandas "dask[complete]"
英文:
As it turns out, the problem was with version compatibility issues between Pandas and Dask. StringMethods is a part of Pandas' string handling functionality, which is used by Dask DataFrames.
However, I didn't know that this attribute was not available in older versions of Pandas.
I updated both libraries and the error was gone:
pip install --upgrade pandas "dask[complete]"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论