[SciPy-User] permutate elements - unique order
Ferdinand
Ferdinand.Gruebler at gmx.de
Mon Feb 14 10:38:59 EST 2011
Oh sorry, I made a mistake ...
of course abc conflicts with cba
It has to be:
function(a,b,c)
a b c
b c a
c a b
sorry for messing it up.
On 14.02.2011, at 15:39, Alan G Isaac wrote:
> On 2/14/2011 8:37 AM, Ferdinand wrote:
>> is there a function or an easy way to generate unique sequences of elements?
>>
>> Like:
>>
>> function(a,b,c)
>>
>> output:
>>
>> a b c
>> b c a
>> c b a
>>
>>
>>
>> (not for example a c b – because a was on the first position already)
>
>
>
>
> This specification appears incomplete:
> is the first position special?
> E.g., why doesn't abc conflict with cba?
>
> The term "unique sequence" suggested you were
> after permutations, but you clearly what something
> more restrictive. (Or if not, see itertools.)
>
> Alan Isaac
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
More information about the SciPy-User
mailing list