[Numpy-discussion] matlab vs. python question

Christopher Barker Chris.Barker at noaa.gov
Thu Apr 26 12:51:57 EDT 2007


Brian Blais wrote:
> I agree with Sturla here, up until Pyrex.  Looking at the Python API, swig, f2py,
> etc. I found mex files far more straightforward.  Mostly this is because of the
> (mostly) single datatype in Matlab: the double matrix.

well, that's not really fair. I've written extensions to Numeric (but 
the same would be true for numpy) that only work on 2-d double arrays -- 
that was easy. Generalizing to other types and shapes is a pain, but you 
don't even have that option with Matlab.

> Having to do reference counting in the Python API is a drag.

Yes, it is. But every tool, other than writing to the C API directly, 
takes care of that for you.

> Now, with Pyrex, that's a different matter entirely.  Pyrex makes extension writing
> so incredibly easy,

Yes, very cool. I haven't used it for anything real, but f2py looks very 
easy too, if you're working with Fortran.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov



More information about the NumPy-Discussion mailing list