【问题标题】:tqdm in Jupyter notebook does not show upJupyter 笔记本中的 tqdm 不显示
【发布时间】:2020-11-18 18:51:31
【问题描述】:

我想在 Jupyter notebook 中实现一个进度条。我尝试使用tqdm,如下面的代码所示,但我只是在屏幕上显示了这个,进度条是……嗯……没有进展:

代码

# Iterate through each sound file and extract the features
from tqdm import tqdm
items = len(metadata.index)
for i in tqdm(range(items), "Completed"):
    for index, row in metadata.iterrows():
        file_name = os.path.join(os.path.abspath(fulldatasetpath),'fold'+str(row["fold"])+'/',str(row["slice_file_name"]))
    
        class_label = row["class_name"]
        data = extract_features(file_name)
    
        features.append([data, class_label])

你能帮我让进度条继续前进吗?谢谢!

【问题讨论】:

    标签: jupyter-notebook tqdm


    【解决方案1】:

    对于 Jupyter 笔记本,您应该使用特殊版本的 tqdm:

    from tqdm.notebook import tqdm
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-08-19
      • 1970-01-01
      • 2018-10-13
      • 1970-01-01
      • 2018-02-26
      • 2020-07-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多