Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unique combinations from a collection #183

Open
peterbayerle opened this issue Feb 20, 2022 · 1 comment
Open

Unique combinations from a collection #183

peterbayerle opened this issue Feb 20, 2022 · 1 comment

Comments

@peterbayerle
Copy link

I noticed there’s a method for counting the unique permutations of a collection - how come there is no equivalent for combinations? For example the unique combinations of length 2 of “aabc” are “aa”, “ab”, “ac”, “bc”. If others think this would be useful Id be interested in trying to implement it !

An equivalent would be more_itertools.distinct_combinations(collection, k) in Python

@dabrahams
Copy link
Contributor

I think this is in there now. But it's misnamed. It should have "subsets" in the name (and no, it doesn't matter that it doesn't create a Set data structure).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants