12

I would like to see the progress bar of the apply function in jupyter notebook.
On Ubuntu everything works fine, on Windows 10 I receive an error.

Code:

from tqdm.notebook import tqdm

tqdm.pandas()

preprocessed_text_test = df.text_col.progress_apply(
    lambda x: [
        x
    ]
)

Error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_23140/2942098042.py in <module>
      3 tqdm.pandas()
      4 
----> 5 preprocessed_text_test = df.text_col.progress_apply(
      6     lambda x: [
      7         x

~\Anaconda3\envs\dev\lib\site-packages\tqdm\std.py in inner(df, func, *args, **kwargs)
    779 
    780                 try:
--> 781                     func = df._is_builtin_func(func)
    782                 except TypeError:
    783                     pass

~\Anaconda3\envs\dev\lib\site-packages\pandas\core\generic.py in __getattr__(self, name)
   5476         ):
   5477             return self[name]
-> 5478         return object.__getattribute__(self, name)
   5479 
   5480     def __setattr__(self, name: str, value) -> None:

AttributeError: 'Series' object has no attribute '_is_builtin_func'

The same error occurs with swifter: pandas.DataFrame.swifter.progress_bar(enable=True, desc=None)

Pandas version: 1.3.0
tqdm version: 4.61.2

Ivan M.
  • 497
  • 6
  • 8

0 Answers0