I think you are right, it's the assignment itself which is slow.
Merged loop is only a tad quicker.
On Thursday, September 8, 2016 at 6:04:41 PM UTC+1, Christian Gollwitzer wrote:
> > Why nested loops are so slow in Python? Is it because new contexts are
> > created?
> > For more details, see
> >
Why nested loops are so slow in Python? Is it because new contexts are created?
For more details, see
http://stackoverflow.com/questions/26611043/numpy-vs-cython-nested-loop-so-slow
http://stackoverflow.com/questions/39371021/efficient-loop-over-numpy-array
Thanks!
--
https://mail.python.org/mail