Trying to flatten a list of lists into one list of unique values:
[[1, 2, 3], [4, 5, 6], [6, 7, 8]]
into [1,2,3,4,5,6,7,8]
where the first list might contain N number of lists.
Trying to flatten a list of lists into one list of unique values:
[[1, 2, 3], [4, 5, 6], [6, 7, 8]]
into [1,2,3,4,5,6,7,8]
where the first list might contain N number of lists.
You could try it like this:
a = [[1,2,3,4], [5,6,7,8]]
nxtList = []
for i in a:
for j in i:
nxtList.append(j)
This won't guarantee that your values are unique, but if you know ahead of time that the list (a) always contains unique values then it won't be a problem.