grouped.grouped_count

grouped.grouped_count(ind: Array, v: Array, filtered: bool = True, chunks: int | tuple[int, ...] | None = None, verbose: bool = False) ndarray[tuple[int], uint64] | DataFrame

Compute the count of each index. NaN values in v are ignored

Parameters:
  • ind (array-like) – index labels

  • v (array-like) – data

  • filtered (bool, optional) – Filter the output in a pandas dataframe, which is the default. If False, this function returns the raw output, where the index of the value corresponds to the index labels.

  • chunks (int or tuple of ints, optional) – Optional chunking of the data, which can be run in parallel in a joblib context

  • verbose (bool, optional) – Print timing

Returns:

counts – The count of each index.

Return type:

np.ndarray or pd.DataFrame