rusi於 2012年10月17日星期三UTC+8下午10時50分11秒寫道: > On Oct 17, 7:37 pm, Dave Angel <d...@davea.name> wrote: > > > > > And I'd wager all the improvement is in the inner loop, the dot() function. > > > > Sorry -- red herring! > > > > Changing > > > > def mm1(a,b): return [[sum(x*y for x,y in zip(ra,rb)) for rb in > > zip(*b)] for ra in a] > > > > to > > > > def mm1(a,b): return [[sum([x*y for x,y in zip(ra,rb)]) for rb in > > zip(*b)] for ra in a] > > > > makes the speed diff vanish
I think a lot people don't work on computations over fields other real and complex. That is why a lot people keep complaining about the speeds of python programs executed. -- http://mail.python.org/mailman/listinfo/python-list