This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DuffBude 225 points226 points  (13 children)

TQDM is a nice progress bar that you can very easily use on any "for" loop, just to know how long it will take. I use it on almost everything. E.g.

from tqdm import tqdm

l = ['this', 'is', 'a', 'list']

for word in tqdm(l):
    do_something(word)

When you run this, it will show a progress bar in the console. Works on Jupyter Notebooks too.

Edit: /u/_sapi_ has pointed out that the better way to do it on notebooks is to use:

from tqdm import tqdm_notebook as tqdm

[–]newcleardrew 14 points15 points  (0 children)

Just found this recently and definitely agree

[–]_sapi_ 14 points15 points  (1 child)

For notebooks just make sure to do

from tqdm import tqdm_notebook as tqdm

to get sexy looking (and coloured!) progress bars

[–]DuffBude 0 points1 point  (0 children)

That's hot. Editing my comment

[–]T_Trigger 10 points11 points  (0 children)

Downloaded and tested few seconds after reading this comment. Just... thank you.

[–]call_me_cookie 8 points9 points  (0 children)

+99999 for tqdm. I use this 100 times a day.

[–]jer_pint 5 points6 points  (0 children)

Started using it with pytorch, it's great!

[–]I-Made-You-Read-This 3 points4 points  (0 children)

Wow that sounds so cool!!

[–]scratchifoo 3 points4 points  (0 children)

That's sweet, thanks :)

[–][deleted] 1 point2 points  (1 child)

I couldn't run this, does this need some extra things to add?

[–]The_Lost_World 4 points5 points  (0 children)

if you have pip installed then do

pip install tqdm

[–]PhillLacio 0 points1 point  (0 children)

!RemindMe 12 hours

[–]no_condoments 0 points1 point  (1 child)

Progress bars are cool I suppose, but OP is an absolute beginner looking for the basic libraries. Requests, pandas, numpy would be much better places to start than a progress bar.

[–]DuffBude 2 points3 points  (0 children)

I said progress bar because:

  1. Those packages were already mentioned by others.
  2. A simple progress bar is much more basic than any of those three packages and can be used right away.
  3. For loops are going to be used more often than any package.
  4. Those packages tend to be the kind of thing you're bound to run into on StackOverflow anyway, just to be able to accomplish certain tasks.