def count(self):
from pandas.core.dtypes.missing import _isna_ndarraylike as _isna<EOL>data, _ = self._get_data_to_aggregate()<EOL>ids, _, ngroups = self.grouper.group_info<EOL>mask = ids != -<NUM_LIT:1><EOL>val = ((mask & ~_isna(np.atleast_2d(blk.get_values())))<EOL>for blk in data.blocks)<EOL>loc = (blk.mgr_locs for blk in data.blocks)<EOL>counter = partial(<EOL>lib.count_level_2d, labels=ids, max_bin=ngroups, axis=<NUM_LIT:1>)<EOL>blk = map(make_block, map(counter, val), loc)<EOL>return self._wrap_agged_blocks(data.items, list(blk))<EOL>
Compute count of group, excluding missing values