I would like to have a list of lists N times deep, and my solution is (in

pseudocode):

def deep(x):

a=[x]

return a

mylist=[]

for N: mylist=deep(mylist)

Is there a more elegant way to do it?

The maine idea is: from a list having the numbre of steps along N

dimensions, generate a list with an item at each possible point.

Example 1: N=2 list=[2,3] result=[[1,2],[1,2],[1,2]]

Example 2: N=3 list=[3,1,2] result=[[[1,2,3]],[[1,2,3]]]

--

ﾃ］gel Gutiﾃｩrrez Rodrﾃ*guez -

http://www.velocityreviews.com/forums/(E-Mail Removed)
Instituto de Ciencia de los Materiales de Madrid - CSIC

SpLine - European Syncrothorn Radiation Facility - Grenoble - France

Postal adress: Departamento de Quﾃ*mica Fﾃ*sica y Analﾃ*tica

Universidad de Oviedo - c/Juliﾃ｡n Claverﾃ*a 8 33006 - Oviedo

Asturias - Spain

E-mail:

(E-Mail Removed) Telf.: +34-985103687