LoginSignup
11
3

More than 5 years have passed since last update.

tqdm の表示の見方

Last updated at Posted at 2019-03-23

Python でプログレスバーといえば、tqdm

基本的な使い方は、

Python: tqdm で処理の進捗状況をプログレスバーとして表示する

あたりを参照。

from tqdm import tqdm
import time

for i in tqdm(range(10)):
    time.sleep(3)

とかしたときに、

 40%|████████████████████████████████                                                | 4/10 [00:12<00:18,  3.00s/it]

とか表示されるのだが、

00:12<00:18

の意味がわからなかった。ネットを調べても出てこなかった。

実験してみた結果、

  • < の左側 (00:12): 現在までの経過時間
  • < の右側 (00:18): 完了までの予想時間

とわかった。

なるほど。 < は砂時計のくびれの部分のイメージなのかもしれない。00:12<00:18 を反時計回りに90度回転させると、砂時計になるイメージだ。

11
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
3