#1810·tqdm

`tqdm.pandas`: 空 DataFrame 会引发 `ZeroDivisionError`,而 `total=` 只会应用一次

作者: yayong3创建于 2026年9月3日更新于 2026年9月3日
  • I have marked all applicable categories:
    • exception-raising bug
    • visual output bug
  • I have visited the source website, and in particular read the known issues
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and environment, where applicable:
    python
    import tqdm, sys
    print(tqdm.__version__, sys.version, sys.platform)

Summary

There are two bugs in tqdm.pandas()'s shared inner closure, empty dataFrames and total= is consumed after the first call.