pd.Series.apply 函数上的进度条在 Windows 上不起作用。 AttributeError: 'Series' 对象没有属性 '_is_builtin_func'

时间:2021-07-20 10:18:00

标签: python tqdm

我想在jupyter notebook中查看apply函数的进度条。
在 Ubuntu 上一切正常,在 Windows 10 上我收到一个错误。

代码:

from tqdm.notebook import tqdm

tqdm.pandas()

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

错误:

---------------------------------------------------------------------------
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'

swifter 出现同样的错误:pandas.DataFrame.swifter.progress_bar(enable=True, desc=None)

熊猫版本:1.3.0
tqdm 版本:4.61.2

0 个答案:

没有答案
相关问题