A library for combinatorics operations and utilities
Project description
Combinatorics Utils
A Python library for generating value combinations, specifically designed to handle combinations with repetition of specific sizes.
Installation
You can install this package locally using pip:
pip install combinatorics_utils
Usage
Combinations with Repetition
Generate combinations of a set of values with a specified size.
from combinatorics_utils import combinations_with_repetition
values = [1, 2, 3]
size = 2
# Generate combinations of length 2 allowing repetition
result = combinations_with_repetition(values, size)
for combo in result:
print(combo)
Example Output:
[1, 1]
[1, 2]
[1, 3]
[2, 2]
[2, 3]
[3, 3]
Features
- Efficient generation of combinations with repetition.
- Logic to prevent duplicate combination sets (multiset equality).
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
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 combinatorics_utils-0.0.2.tar.gz.
File metadata
- Download URL: combinatorics_utils-0.0.2.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ae3da56ac5e612e3e78e8529596b162d11772bbf7e1c322b5446d1950245103
|
|
| MD5 |
5a3c3cb3318b318517cfb9b4189ebdcf
|
|
| BLAKE2b-256 |
456311833c86a211d1d739dc3827c8c053ef44557b9f5bbfc5b0f74f236c14f3
|
File details
Details for the file combinatorics_utils-0.0.2-py3-none-any.whl.
File metadata
- Download URL: combinatorics_utils-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c71a9e5f23d01dc3397d6d587e68578bc5a20bd1cd7347748747d684ac21b246
|
|
| MD5 |
a1a5439ed9126df76c3ffd5617b33c7b
|
|
| BLAKE2b-256 |
7690e4b198f10fc3d1df537dc4d56d0b990f98c1cf81f2fd9bfe9e0ee2066d22
|