【发布时间】:2021-08-05 10:46:43
【问题描述】:
我正在使用 tqdm 作为进度条。这是示例代码
from tqdm import tqdm
import numpy as np
import pandas as pd
for index_len in tqdm(range(0,len(data_elim))):
# Doing something here where i get a array of rows which i need to delete
data_elim = np.delete(data_elim.values,same_residues,0
data_elim = pd.DataFrame(data_elim)
所以在这种情况下,我的初始长度是 17 百万,但随着它的进一步发展,它会减少并最终归零。但在我的进度条中,它始终显示为列表的初始长度。无论如何我也可以在进度栏中更改该数字吗?
【问题讨论】:
-
您是否将代码用于较小的数据集?如果您的总行数为 17M,则在删除 170K 行后,进度条的 1% 将发生变化(假设进度条每 1% 更新一次)。也许没有足够的时间发生这种情况?
标签: python-3.x progress-bar tqdm