[Numpy-discussion] Extracting all the possible combinations of a grid

Alan G Isaac aisaac at american.edu
Sat Sep 22 00:09:16 EDT 2007


On Fri, 21 Sep 2007, Stephen McInerney apparently wrote:
> The pure Pythonic solution is a list comprehension involving multiple sequences:
> x = range(0,n)
> y = x 
> z = x 
> t = [(xx,yy,zz) for xx in x for yy in y for zz in z] 

Different question ...

Cheers,
Alan Isaac






More information about the NumPy-Discussion mailing list