Skip to content

Commit a67b07f

Browse files
committed
Merge pull request pandas-dev#11025 from sinhrks/groupby_count_doc
DOC: Add GroupBy.count
2 parents 789e07d + 2eff311 commit a67b07f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/core/groupby.py

+8
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,12 @@ def irow(self, i):
719719
FutureWarning, stacklevel=2)
720720
return self.nth(i)
721721

722+
def count(self):
723+
""" Compute count of group, excluding missing values """
724+
725+
# defined here for API doc
726+
raise NotImplementedError
727+
722728
def mean(self):
723729
"""
724730
Compute mean of groups, excluding missing values
@@ -2674,6 +2680,7 @@ def value_counts(self, normalize=False, sort=True, ascending=False,
26742680
return Series(out, index=mi)
26752681

26762682
def count(self):
2683+
""" Compute count of group, excluding missing values """
26772684
ids, _, ngroups = self.grouper.group_info
26782685
val = self.obj.get_values()
26792686

@@ -3458,6 +3465,7 @@ def _apply_to_column_groupbys(self, func):
34583465
keys=self._selected_obj.columns, axis=1)
34593466

34603467
def count(self):
3468+
""" Compute count of group, excluding missing values """
34613469
from functools import partial
34623470
from pandas.lib import count_level_2d
34633471
from pandas.core.common import _isnull_ndarraylike as isnull

0 commit comments

Comments
 (0)