counter#
- class counter(iterable=None, /, **kwds)[source]#
Bases:
CounterLike
collections.Counter, but with additional supported mathematical operations.sc.counterhas an “array” property, which converts the values to a NumPy array; methods not available to aCounterobject are performed on the array instead.Examples:
vals = [1,1,12,3,4,2,4,2,53,5,5,6,2,3,5] counts = sc.counter(vals) counts.max() # returns 3
New in version 3.2.3.Attributes
NumPy array of values
Methods
- property array#
NumPy array of values