We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a012f4b commit b250bceCopy full SHA for b250bce
pandas/core/groupby/generic.py
@@ -46,7 +46,6 @@
46
from pandas.core.index import Index, MultiIndex, CategoricalIndex
47
from pandas.core.arrays.categorical import Categorical
48
from pandas.core.internals import BlockManager, make_block
49
-from pandas.compat.numpy import _np_version_under1p13
50
51
from pandas.plotting._core import boxplot_frame_groupby
52
@@ -1208,10 +1207,7 @@ def count(self):
1208
1207
1209
mask = (ids != -1) & ~isna(val)
1210
ids = ensure_platform_int(ids)
1211
- minlength = ngroups or 0
1212
- if _np_version_under1p13 and minlength == 0:
1213
- minlength = None
1214
- out = np.bincount(ids[mask], minlength=minlength)
+ out = np.bincount(ids[mask], minlength=ngroups or None)
1215
1216
return Series(out,
1217
index=self.grouper.result_index,
0 commit comments