From 39f8d615076637f39571e14c0742072be8485f5f Mon Sep 17 00:00:00 2001 From: toddrme2178 Date: Thu, 17 May 2018 15:33:25 -0400 Subject: [PATCH] Support pandas 0.23.0 `core.groupby` module layout `pandas.core.groupby` has been moved to `pandas.core.groupby.groupby` for pandas 0.23.0. See pandas pull request [#20506](https://github.com/pandas-dev/pandas/pull/20506). --- tqdm/_tqdm.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tqdm/_tqdm.py b/tqdm/_tqdm.py index ff551c97..749d9928 100755 --- a/tqdm/_tqdm.py +++ b/tqdm/_tqdm.py @@ -539,16 +539,23 @@ class tqdm(Comparable): """ from pandas.core.frame import DataFrame from pandas.core.series import Series - from pandas.core.groupby import DataFrameGroupBy - from pandas.core.groupby import SeriesGroupBy - from pandas.core.groupby import GroupBy - from pandas.core.groupby import PanelGroupBy from pandas import Panel try: # pandas>=0.18.0 from pandas.core.window import _Rolling_and_Expanding except ImportError: # pragma: no cover _Rolling_and_Expanding = None + try: + # pandas>=0.23.0 + from pandas.core.groupby.groupby import DataFrameGroupBy + from pandas.core.groupby.groupby import SeriesGroupBy + from pandas.core.groupby.groupby import GroupBy + from pandas.core.groupby.groupby import PanelGroupBy + except ImportError: + from pandas.core.groupby import DataFrameGroupBy + from pandas.core.groupby import SeriesGroupBy + from pandas.core.groupby import GroupBy + from pandas.core.groupby import PanelGroupBy deprecated_t = [tkwargs.pop('deprecated_t', None)]