counter
Categorical Counter for Dataset Metrics.
This module defines the Counter
class, which enables counting occurrences of various
categories. It provides methods for incrementing category counts, clearing data, and
retrieving the current counter state. This functionality is particularly useful in
analyzing datasets, tracking runtime metrics, or categorizing data for further
processing.
Example
Classes
Counter
A class that implements a categorical counters.
Functions
__len__
Returns the number of categories in the counter.
Returns:
-
int
(int
) –The number of categories in the counter.
__str__
Returns a string representation of the counter data.
Returns:
-
str
(str
) –A string representation of the counter data.