: tutor-bounces+robert.johansson=math.umu...@python.org
[mailto:tutor-bounces+robert.johansson=math.umu...@python.org] För Michael
Morrissey
Skickat: den 18 december 2009 06:54
Till: tutor@python.org
Ämne: [Tutor] Generating Unique Permutations
I'm just a philosophy teacher, and I don't
On Fri, Dec 18, 2009 at 12:54 AM, Michael Morrissey wrote:
> I'm looking for an efficient way to create all the unique, non-duplicated
> permutations of a list (I believe these are called "necklaces" in
> combinatorics). I need to do this without actually generating every possible
> permutation (w
may be this can be helpful:
http://blog.bjrn.se/2008/04/lexicographic-permutations-using.html
On Fri, Dec 18, 2009 at 6:01 PM, R. Alan Monroe wrote:
>
> > I'm looking for an efficient way to create all the unique, non-duplicated
> > permutations of a list
>
> This may or may not help:
> http://c
> I'm looking for an efficient way to create all the unique, non-duplicated
> permutations of a list
This may or may not help:
http://code.activestate.com/recipes/190465/
Alan
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscripti
Michael Morrissey dixit:
> I'm just a philosophy teacher, and I don't know much about mathematics or
> computers. I'm writing a python program (not the best language for this
> topic, but it is what I know), and I need to solve a problem which requires
> more knowledge than I have. I'm hoping you
create your desired list
>>> l = ['a', 'a', 'b', 'b']
do a permutation and take unique values
>> import itertools
>> set(itertools.permutations(l))
HTH
On Fri, Dec 18, 2009 at 11:24 AM, Michael Morrissey wrote:
> I'm just a philosophy teacher, and I don't know much about mathematics or
> comput
I'm just a philosophy teacher, and I don't know much about mathematics or
computers. I'm writing a python program (not the best language for this
topic, but it is what I know), and I need to solve a problem which requires
more knowledge than I have. I'm hoping you can help me. =)
I'm looking for a