bigframes.pandas.api.typing.SeriesGroupBy.count#

SeriesGroupBy.count() Series[source]#

Compute count of group, excluding missing values.

Examples:

For SeriesGroupBy:

>>> lst = ['a', 'a', 'b']
>>> ser = bpd.Series([1, 2, np.nan], index=lst)
>>> ser.groupby(level=0).count()
a     2
b     0
dtype: Int64

For DataFrameGroupBy:

>>> data = [[1, np.nan, 3], [1, np.nan, 6], [7, 8, 9]]
>>> df = bpd.DataFrame(data, columns=["a", "b", "c"],
...                    index=["cow", "horse", "bull"])
>>> df.groupby(by=["a"]).count()
   b  c
a
1  0  2
7  1  1

[2 rows x 2 columns]
Returns:

Count of values within each group.

Return type:

bigframes.pandas.DataFrame or bigframes.pandas.Series