From ef1a310262fabaffd6b87df13c02bfba8e88f9da Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Wed, 15 Feb 2023 11:26:41 -0800 Subject: [PATCH] drop Series constructor --- python/cudf/cudf/core/groupby/groupby.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/python/cudf/cudf/core/groupby/groupby.py b/python/cudf/cudf/core/groupby/groupby.py index a4179350078..8ff3e17d6ff 100644 --- a/python/cudf/cudf/core/groupby/groupby.py +++ b/python/cudf/cudf/core/groupby/groupby.py @@ -298,14 +298,13 @@ def dtypes(self): 3 object int64 """ index = self.grouping.keys.unique().to_pandas() - result = pd.DataFrame( + return pd.DataFrame( { - name: pd.Series([self.obj._dtypes[name]]).repeat(len(index)) + name: [self.obj._dtypes[name]] * len(index) for name in self.grouping.values._column_names }, + index=index, ) - result.index = index - return result @cached_property def groups(self):