Counter

Standard library class collections.Counter View source
class Counter
class Counter[T]
Fields 1
T type
Constructors 3
__init__
__init__(self, elements: Generator[T])
Defined in collections
__init__
__init__(self, other: Counter[T])
Defined in collections
__init__
__init__(self, other: OrderedDict[T, int])
Defined in collections
Methods 5
elements
elements(self)
Defined in collections
most_common
most_common(self, n: Optional[int] = None)
Defined in collections
subtract
subtract(self, elements: Generator[T])
Defined in collections
subtract(self, other: Counter[T])
Defined in collections
subtract(self, other: OrderedDict[T, int])
Defined in collections
update
update(self, elements: Generator[T])
Defined in collections
update(self, other: Counter[T])
Defined in collections
update(self, other: OrderedDict[T, int])
Defined in collections
update(self)
Defined in collections
total
total(self)
Defined in collections
Special methods 17
__getitem__
__getitem__(self, key: T)
Defined in collections
__delitem__
__delitem__(self, key: T)
Defined in collections
__eq__
__eq__(self, other: Counter[T])
Defined in collections
__ne__
__ne__(self, other: Counter[T])
Defined in collections
__copy__
__copy__(self)
Defined in collections
__iadd__
__iadd__(self, other: Counter[T])
Defined in collections
__isub__
__isub__(self, other: Counter[T])
Defined in collections
__iand__
__iand__(self, other: Counter[T])
Defined in collections
__ior__
__ior__(self, other: Counter[T])
Defined in collections
__pos__
__pos__(self)
Defined in collections
__neg__
__neg__(self)
Defined in collections
__add__
__add__(self, other: Counter[T])
Defined in collections
__sub__
__sub__(self, other: Counter[T])
Defined in collections
__and__
__and__(self, other: Counter[T])
Defined in collections
__or__
__or__(self, other: Counter[T])
Defined in collections
__repr__
__repr__(self)
Defined in collections
__dict_do_op_throws__
__dict_do_op_throws__(self, key: T, other: Z, op: F, F: type, Z: type)
Defined in collections