英文:
Converting from dictionary to Dask HighLevelGraph
问题
Dask的HighLevelGraph有一个将其转换为Python dict
的方法,但是如何从dict
构建HighLevelGraph
(执行反向过程)尚不清楚。或者,是否有一种方法可以从代表图的dict
中获取依赖项(类似于HighLevelGraph.dependencies
)?
英文:
Dask's HighLevelGraph has a method to convert it to a Python dict
, however, it is not clear how to build the HighLevelGraph
from a dict
(doing the reverse process). Alternatively, is there a way to get the dependencies (as in HighLevelGraph.dependencies
) from a dict
representing the graph ?
答案1
得分: 1
找到了自己问题的答案,您可以使用HighLevelGraph
中的HighLevelGraph.from_collections
方法,从一个dict
创建一个新的HighLevelGraph
,如下所示:
dsk = HighLevelGraph.from_collections(<name>, <any dict>)
英文:
Found the answer to my own question, you can use the HighLevelGraph.from_collections
method from HighLevelGraph
to create a new HighLevelGraph
from a dict
, as shown below:
dsk = HighLevelGraph.from_collections(<name>, <any dict>)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论