gabriele tosti
gabriele tosti

Reputation: 73

get rid of the ETA and rate on tqdm progress bar?

There is a way to get rid of the ETA and rate of a tqdm progress bar?

I've this bar:

fuoco: 100%|██████████████████████████████████████████████████████████████| 10/10 [00:05<00:00,  2.00it/s]

I need to remove the elapsed and remaining time:

10/10 [00:05<00:00,  2.00it/s]

Upvotes: 6

Views: 3717

Answers (2)

Nicolas Busca
Nicolas Busca

Reputation: 1305

You can wrap the iterable into an object without a length. For example:

import time
import tqdm
for i in tqdm.tqdm(iter(range(100)),bar_format='{elapsed}<{remaining}'):
    ##             ^^^^
    ## iter returns an iterator without a known length
    ## when the length is unknown tqdm won't print ETA info 
    time.sleep(1)

Upvotes: 1

Daweo
Daweo

Reputation: 36680

You need to provide bar_format parameter if you want to have other information/format than default, please try following

bar_format='{elapsed}<{remaining}'

example

import time
import tqdm
for i in tqdm.tqdm(range(100),bar_format='{elapsed}<{remaining}'):
    time.sleep(1)

look after finish

01:41<00:00

Consult linked page too see other possible values to use in bar_format.

Upvotes: 5

Related Questions