1 | initial version |
Assume that your array of lists is stored in my_lists
. Then, the lines
sets = map(set,my_lists)
union(map(tuple,sets))
do the trick. You get a list a tuples whose elements are unique, as wanted. For example, if
my_lists = Permutations([3,1,2]).list() + Permutations([6,5,4]).list()
then the above two lines yield
[(4, 5, 6), (1, 2, 3)]
2 | No.2 Revision |
Assume that your array of lists is stored in my_lists
. Then, the lines
sets = map(set,my_lists)
union(map(tuple,sets))
do the trick. You get a list a of tuples whose elements are unique, as wanted. For example, if
my_lists = Permutations([3,1,2]).list() + Permutations([6,5,4]).list()
then the above two lines yield
[(4, 5, 6), (1, 2, 3)]
3 | No.3 Revision |
Assume that your array of lists is stored in my_lists
. Then, the lines
sets = map(set,my_lists)
union(map(tuple,sets))
do the trick. You get a list of tuples whose elements are unique, as wanted. For example, if
my_lists = Permutations([3,1,2]).list() + Permutations([6,5,4]).list()
then the above two lines yield
[(4, 5, 6), (1, 2, 3)]