"wang frank" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
|        z=log(j);

This matlab code is faster in part than your Python equivalent:

| > >                         z=math.log(m)

because of the repeated lookup of log in the math module.
So, replace

| > > import math

with

from math import log

Also make that the top line of the function so 'log' is a local variable. 
Then delete 'math.' everywhere.

That said, such artificial benchmarks do not strike me as terribly useful. 
More useful, for instance, for appropriate applications, might be doing a 
fourier transform on a 2**20 length vector with both matlab and numpy/scipy

tjr



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to