2

I'm using tqdm combined with Pandas on Jupyter notebooks.

I have a Pandas dataframe df. When i use df.progress_apply, new lines are printed instead of updating only one.

This is what I currently do :

tqdm.pandas(desc="Computing MONTH...")
df["MONTH"] = df.progress_apply(compute_month, axis=1)

A newline is made after each print

My question is not a duplicate of this question : tqdm in Jupyter Notebook

because they said to use tqdm_notebook instead of tqdm. I can't use tqdm_notebook as I need to implement df.progress_apply.

I can't reproduce this issue on a minimal example because my code is too heavy.

Here is an issue in Github related of this problem but couldn't help me : https://github.com/tqdm/tqdm/issues/375

Salem
  • 401
  • 5
  • 15

1 Answers1

0

You should do something like that:

from tqdm import tqdm_notebook
tqdm_notebook().pandas()

And that will do!

Dmitry Pekach
  • 161
  • 2
  • 9