如何查看Dask Compute任务的进度? [英] How to see progress of Dask Compute task?
本文介绍了如何查看Dask Compute任务的进度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用Dask运行计算任务时,我想在Jupyternotebook上看到一个进度条,我正在计算+ 4GB的大型csv文件中"id"列的所有值,所以有什么想法吗?
I would like to see a progressbar on Jupyternotebook while i'm running a compute task using Dask, I'm counting all values of "id" column from a large csv file +4GB, so any ideas?
import dask.dataframe as dd
df = dd.read_csv('data/train.csv')
df.id.count().compute()
推荐答案
如果您使用的是单个计算机调度程序,请执行以下操作:
If you're using the single machine scheduler then do this:
from dask.diagnostics import ProgressBar
ProgressBar().register()
http://dask.pydata.org/en/latest/diagnostics- local.html
如果您使用的是分布式调度程序,请执行以下操作:
If you're using the distributed scheduler then do this:
from dask.distributed import progress
result = df.id.count.persist()
progress(result)
或者仅使用仪表板
http://dask.pydata.org/en/latest/diagnostics- distribution.html
这篇关于如何查看Dask Compute任务的进度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文