I have the following code:
areas=[1,2,3,4,5,6,7,8,9]
filas=np.sqrt(len(areas))
i=0
matriz=[]
while i < filas:
globals()['L%s'%(i+1)]=areas[(len(areas)//filas)*i:(len(areas)//filas)*(i+1)]
matriz.append('L%s'%(i+1))
i+=1
This just gives me:
matriz=['L1','L2','L3']
What I want to get is:
matriz=[[1,2,3],[4,5,6],[7,8,9]]
I wanted something general because actually I have to do this in a list of 1600 elements, so I will have up to L40 lists in my list "matriz".