Skip to main content

provides a convenient and efficient way to count the occurrences of items (hashable and unhashable)

Project description

provides a convenient and efficient way to count the occurrences of items (hashable and unhashable)

pip install screwhashcounter

Tested against Windows 10 / Python 3.10 / Anaconda

Count the occurrences of items in a list, tuple and return a list of tuples with the item and its count.

Args:
	arg (list|tuple): The list|tuple containing items to be counted.

Returns:
	list[tuple]: A list of tuples where each tuple contains an item and its count.

Example:
	from screwhashcounter import countitems
	counted_items = countitems(
		["mississippi", [1, 2], [1, 2], {34, 4, 3}, {1: 2}, {1: 2}, None, 3]
	)
	print(counted_items)
	# Output: [('mississippi', 1), ([1, 2], 2), ({34, 3, 4}, 1), ({1: 2}, 2), (None, 1), (3, 1)]

Project details


Release history Release notifications | RSS feed

This version

0.10

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

screwhashcounter-0.10.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

screwhashcounter-0.10-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page