gpt4 book ai didi

python - 正在解析 "AttributeError: module ' dask.bag' 没有属性 'from_filenames' "

转载 作者:太空宇宙 更新时间:2023-11-03 13:59:19 26 4
gpt4 key购买 nike

我正在按照一个简单的教程将 Reddit 评论数据从 Pushshift.io 加载到 dask 包中。我收到奇怪的错误:“正在解析“AttributeError:模块'dask.bag'没有属性'from_filenames'””,尽管事实上这是标准过程,如下所述:http://dask.pydata.org/en/doc-test-build/bag.html

import dask
import dask.bag as db

data = db.from_filenames("reddit_1_28_2018.txt", chunkbytes=100000).map(json.loads)

AttributeError Traceback (most recent call last)
<ipython-input-17-bcbd31affbfb> in <module>()
2 import dask.bag as db
3
----> 4 data = db.from_filenames("reddit_1_28_2018.txt", chunkbytes=100000).map(json.loads)

AttributeError: module 'dask.bag' has no attribute 'from_filenames'

最佳答案

我怀疑您正在查看的资源非常旧。我建议阅读the Dask documentation了解最新信息。

我怀疑您正在寻找 db.read_text

关于python - 正在解析 "AttributeError: module ' dask.bag' 没有属性 'from_filenames' ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49366412/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com