3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【機械学習】進捗状況をさくっと表示

Last updated at Posted at 2019-07-19

機械学習などで重たい処理を走らせると、進捗状況の見えない処理待ちでデスクを離れるに離れられなく途方に暮れる事が多々あるのですが、進捗を簡単に表示出来る外部パッケージがしっかり用意されていました。

インストール

自分はanaconda環境なので初めから入っていましたが、もし入っていない場合はpipでインストールできます。

pip install tqdm

使い方は超簡単

from tqdm import tqdm_notebook as tqdm

インポートをしたら

for i in tqdm(range(10000000)):
    result = i * i

for文などのイテレータ部を囲って引数にするだけでOK!
するとこんな感じでプログレスバーが表示されるので、その間に安心してひと息入れる事ができます。
スクリーンショット 2019-07-19 15.22.32のコピー.png

因みに対話モードでも使用できます。

定番ツールのようですが、まだ知らない誰かの役に立つと幸いです^^

3
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
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?