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
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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file screwhashcounter-0.10.tar.gz.
File metadata
- Download URL: screwhashcounter-0.10.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
334feab6477938c1e2fe6aef0dabfa48159128b4305a93899d607396508c97e1
|
|
| MD5 |
80b52f7f8ea931901f8c8e7e0da0291d
|
|
| BLAKE2b-256 |
854eef82543c6d2681f1697f8f4c4af3b04f2d19a023902ab371fd515b84085f
|
File details
Details for the file screwhashcounter-0.10-py3-none-any.whl.
File metadata
- Download URL: screwhashcounter-0.10-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4df679deee8604323777d642c788de207689ce73e023afce7b89decdf463c1bd
|
|
| MD5 |
9cd142c8794154dede992b7b67f336ae
|
|
| BLAKE2b-256 |
f76f73400e53dd5b8c23f34d045312c41b221599b5031df913eb96a3e2c65c1e
|