我正在使用dask_yarn对公司集群进行数据分析。
Dask正在指定链接上显示仪表板。完成所有任务后,我想将dask仪表板另存为svg文件。
工具栏中没有用于执行此操作的工具。
如何将结果保存为svg?
发布于 2021-04-17 08:21:14
虽然似乎不能直接使用get_task_stream
进行保存,但您可以使用存储在任务流对象中的bokeh
图形作为ts.figure
from dask.distributed import Client, get_task_stream
import time
client = Client()
with get_task_stream(client, plot='save', filename='task_stream.html') as ts:
futs = client.map(lambda x: time.sleep(x**2), range(5))
results = client.gather(futs)
from bokeh.io import export_png
# note to use this you will need to install additional modules
# conda install -c conda-forge firefox geckodriver
# or see https://docs.bokeh.org/en/latest/docs/user_guide/export.html
export_png(ts.figure, filename="plot.png")
还有其他方法可以导出bokeh地物,请参见docs。
https://stackoverflow.com/questions/67135877
复制相似问题