I have a data set that looks like this:
data = [ [[a,b],[a,d]], [[e,f],[g,h]], [[i,j],[k,j]] ]
And I want to unzip it so I have:
[[a,a], [e,g], [i,k]] and [[b,d], [f,h], [j,j]]
Along the same line, is there a way to get the length of list, without counting duplicates based on one value? For example, using the first list above, I want to count the number of lists in each sublist, without counting duplicates in the second value. So I want to get:
[2, 2, 1]
I'm able to get a result of [2, 2, 2] using:
count = [len(i) for i in data]
but since I can't separate the values, there is no way to check for duplicates in the second value alone.