How to fix the tqdm progress bar which is broken with print statements #python #datascience
I’m getting this output:
import tqdm
for alpha in tqdm.tqdm(np.linspace(0.01, 1, 20)):
print(alpha, flush=True)
because of the “print” statement.
Here’s the proper way:
for alpha in tqdm.tqdm(np.linspace(0.01, 1, 20)):
tqdm.tqdm.write(str(alpha))