Skip to content

Commit 2579484

Browse files
authored
CLN: simplify get_values usage in groupby (#32523)
1 parent 4867415 commit 2579484

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pandas/core/groupby/generic.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
is_scalar,
5050
needs_i8_conversion,
5151
)
52-
from pandas.core.dtypes.missing import _isna_ndarraylike, isna, notna
52+
from pandas.core.dtypes.missing import isna, notna
5353

5454
from pandas.core.aggregation import (
5555
is_multi_agg_with_relabel,
@@ -1772,10 +1772,8 @@ def count(self):
17721772
ids, _, ngroups = self.grouper.group_info
17731773
mask = ids != -1
17741774

1775-
vals = (
1776-
(mask & ~_isna_ndarraylike(np.atleast_2d(blk.get_values())))
1777-
for blk in data.blocks
1778-
)
1775+
# TODO(2DEA): reshape would not be necessary with 2D EAs
1776+
vals = ((mask & ~isna(blk.values).reshape(blk.shape)) for blk in data.blocks)
17791777
locs = (blk.mgr_locs for blk in data.blocks)
17801778

17811779
counted = (

0 commit comments

Comments
 (0)