0

I am using the following code to track a job progress:

from tqdm import tqdm, tqdm_pandas
tqdm.pandas(tqdm())

my_df['target'] = my_df.progress_apply(lambda x: my_fun(x), axis = 1)

Then the code provide progress tracking like below:

  0%|          | 0/5 [00:00<?, ?it/s]
 20%|██        | 1/5 [00:06<00:26,  6.62s/it]
215it [00:06,  4.63s/it]                     
1062it [00:06,  3.24s/it]
1976it [00:06,  2.27s/it]
2893it [00:07,  1.59s/it]
3811it [00:07,  1.11s/it]
4720it [00:07,  1.28it/s]
5650it [00:07,  1.83it/s]
6585it [00:07,  2.62it/s]
7520it [00:07,  3.74it/s]
8444it [00:07,  5.35it/s]
9378it [00:07,  7.64it/s]
10311it [00:07, 10.90it/s]
11218it [00:07, 15.57it/s]
12111it [00:08, 22.22it/s]
13004it [00:08, 31.70it/s]
13832it [00:08, 45.20it/s]
14618it [00:08, 64.36it/s]
15404it [00:08, 91.62it/s]
16149it [00:08, 129.91it/s]
16870it [00:08, 184.16it/s]
17560it [00:08, 259.28it/s]
18315it [00:08, 365.02it/s]
19162it [00:09, 512.00it/s]
19891it [00:09, 706.09it/s]
       :
       :

I am wondering is it possible to print out info every 5 seconds instead of 10 outputs per second? Thanks a lot!

1 Answer 1

1

Yes, just use the mininterval argument:

tqdm.pandas(tqdm, mininterval=5)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.