Skip to content

tqdm.pandas() ImportError: cannot import 'PanelGroupBy' #555

@aaronkollasch

Description

@aaronkollasch

When using tqdm v4.23.3 and pandas v0.23.0, I get this error:

>>> from tqdm import tqdm
>>> tqdm.pandas()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/username/.conda/envs/py36/lib/python3.6/site-packages/tqdm/_tqdm.py", line 545, in pandas
    from pandas.core.groupby import PanelGroupBy
ImportError: cannot import name 'PanelGroupBy'

It looks like pandas has moved GroupBy to a submodule, and PanelGroupBy is not included in pandas/core/groupby/__init__.py, though it remains in pandas/core/groupby/groupby.py.

Thus, for the latest version of pandas, PanelGroupBy can only be imported using from pandas.core.groupby.groupby import PanelGroupBy.

I've reverted to the previous version of pandas and that fixed the problem, so this is a heads up for the newest and future pandas versions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions