I have the following problem. I want to extend a numpy array in a loop, so that each array is seperated from the next like a=[[1,2,3,4,5],[1,2,3,4,5]],b=[[1,2,3,4,5],[1,2,3,4,5]]-->[[[1,2,3,4,5],[1,2,3,4,5]],[[1,2,3,4,5],[1,2,3,4,5]]]
My approach so far:
count=0
for i in range(int(max(allCoo[:,4]))+1):
mask1 = allCoo[:,4] == count
if count>0:
trackList=np.vstack((trackList,np.array((allCoo[mask1]))))
else:
trackList=np.array((allCoo[mask1]))
count+=1
But this just give me things like: [[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]]
Best regards
stack/concatenateonce at the end.