Pythonic way to iterate through multidimensional space?

Tim Chase python.list at tim.thechases.com
Wed Aug 6 07:39:23 EDT 2014


On 2014-08-06 11:04, Gayathri J wrote:
> Below is the code I tried to check if itertools.product() was
> faster than normal nested loops...
> 
> they arent! arent they supposed to be...or am i making a mistake?

I believe something like this was discussed a while ago and there was
a faster-but-uglier solution so you might want to consult this thread:

https://mail.python.org/pipermail/python-list/2008-January/516109.html

I believe this may have taken place before itertools.product() came
into existence.

-tkc





More information about the Python-list mailing list