I have a list of lists:
ex = [['1001'],['0010'],['1101'],['0000']]
I want to split this list of lists into smaller lists. And I have another list which consists of indices where I want to make a split:
track = [1,3]
So I want to split this list of lists to give me following result:
sublist = [
[[1,0],[0,0],[1,1],[0,0]],
[[0,1],[1,0],[0,1],[0,0]]
]
I've tried it on just a simple list:
ex = [1,0,0,1]
start = 0
position = []
for i in track:
position.append(ex[start:i+1])
start = i+1
But in this case my list is already has integer whereas the original list has strings.
How can I achieve this on a list of list which has strings instead of integer? I don't quite know from where to begin?