[Numpy-discussion] Numpy performance vs Matlab.

Sturla Molden sturla@molden...
Wed Jan 7 12:32:58 CST 2009

On 1/7/2009 6:56 PM, Christopher Barker wrote:

>> So for simple loops python looses, but for other things, python wins
>> by a huge margin.
> which emphasizes the point that you can't write code the same way in the 
> two languages, though I'd argue that that code needs refactoring in any 
> language!

Roux example would be bad in either language. Slices ('vectorization' in 
Matlab lingo) is preferred in both cases. It's just that neither Matlab 
nor Python/NumPy was designed to be used like Java. For loops should not 
be abused in Python nor in Matlab (but Matlab is more forgiving now than 
it used to be).

Sturla Molden

More information about the Numpy-discussion mailing list