从字典转换为Dask HighLevelGraph

huangapple go评论50阅读模式
英文:

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(&lt;name&gt;, &lt;any dict&gt;)

huangapple
  • 本文由 发表于 2023年2月27日 04:40:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/75574884.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定