Python中用于For循环的tqdm

5

我正在使用 tqdm 来跟踪 Python 中的 for 循环进度。

import numpy as np
from tqdm import tqdm 

x = np.arange(20000000)

x_30 = []

for _x in tqdm(x):
    x_30.append(_x**30)

进度条长这样: enter image description here 请问您能否解释一下进度条的作用?因为我不是很理解。
1个回答

6
条形码的格式为:
{progress in percentage} | {bar} | {processed}/{total} [{elapsed time}<{remaining time}, {number of iterations per seconds} it/s]

您可以在文档中的 bar_format 中找到更多信息。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接