counter

package module
v0.0.0-...-d7beee5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 1 Imported by: 0

README

counter

Just like collections.Counter of Python

Methods

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

Counter is used to count hashable items, Sometimes called a bag or multiset. Elements are stored as dictionary keys and their counts are stored as dictionary values.

func NewCounter

func NewCounter(item interface{}) *Counter

func NewNullCounter

func NewNullCounter() *Counter

func (*Counter) Clear

func (c *Counter) Clear()

func (*Counter) Copy

func (c *Counter) Copy()

func (*Counter) Elements

func (c *Counter) Elements()

func (*Counter) FromKeys

func (c *Counter) FromKeys()

func (*Counter) Get

func (c *Counter) Get()

func (*Counter) Items

func (c *Counter) Items() *map[interface{}]interface{}

func (*Counter) Keys

func (c *Counter) Keys()

func (*Counter) MostCommon

func (c *Counter) MostCommon()

func (*Counter) Pop

func (c *Counter) Pop()

func (*Counter) PopItem

func (c *Counter) PopItem()

func (*Counter) SetDefault

func (c *Counter) SetDefault()

func (*Counter) Subtract

func (c *Counter) Subtract()

func (*Counter) Update

func (c *Counter) Update()

func (*Counter) Values

func (c *Counter) Values()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL