How to merge the list in python -
i read this, this, , this, no solution.
i have list of 50 lists this:
datatest=[list1,list2,list3,...,list50]
each of lists list of images along labels. mean first dimension of list1 consists of images, , second dimension of list1 corresponding labels. this:
list1=[images,labels]
for example, list1 list 700 images label 0. list2 list 1000 images label 1, ... hence, have list of 50 lists in each individual list comes size 2.
i want merge list in order following matrix. mean array this:
datatest=[images of list1,2,3,...,50 , labels of list1,2,3,...,50]
so, have list 2 size. first dimension images lists, , second dimension labels of images
is want:
a=[[1,2],[2,3]] [v d in v in d] [1, 2, 2, 3]
changed after op's edit:
a=[[2,3],[2,3]] c=[] c.append([v[0] v in a]) c.append([v[1] v in a]) print c [[2, 2], [3, 3]]
Comments
Post a Comment