Comparing Python to (free) Math languages/environments

Ionel Simionescu ionel at psy.uva.nl
Thu Nov 18 14:41:37 CET 1999


Dparsavand <dparsavand at aol.com> wrote in message
news:19991118014716.13748.00000334 at ng-bj1.aol.com...
| I've browsed some interesting links from www.python.org and I have played
just
| a little with Python and Scilab.  I have used Matlab a fair amount in
school
| and find Octave to be a reasonable replacement.  I'm curious if anyone has
used
| any free Math scripting language or Math environment (Rlab, Scilab,
Octave,
| others?) as well as Python and might care to compare them.
|
| I tried to compare Octave to Python in terms of speed by producing some
random
| vectors and taking FFT's and Python seemed to by about twice as fast.
However,
| I'm not too keen on the syntax of Python for some things compared to
Octave
| (e.g. A*B vs. matrixmultiply(A,B)).  I read that one frustration with
Matlab
| (and I imagine Octave as well) is the limit to two-dimensional arrays,
which
| has bugged me in the past.
|
| I also read the CP4E proposal, and  I can definitely relate to the part
about
| how nice it would be to be able to modify the code in my GPS unit (mine
drives
| me crazy).  Python sounds great for these type of things, but does it
really
| make the best Math language?
|

Hi,

Python is a very nice language, to the extent it may be addicting.

However, the suitability of a certain language for a certain task, is also
determined by the availability of specialized libraries.

The support for (possibly multi-dimensional, heterogeneous) array
manipulation, some numerically intensive jobs and scientific visualization
is very good in the Python library.
(See, the relevant SIGs (Special Interest Groups) for pointers.)

However, this support is pretty generic.
If you have very specialized problems in fields such as DSP, ODE's, Kalman
filtering, time series, advanced statistics, then you better use one of the
field experts:
MATLAB/Mathematica/O-Matrix/Scilab/Octave/Gauss/Mathcad/etc.

"Better" does not mean that you'll be very happy coding, but you will get
*safer* results *faster*. You shall also find a lot more support in those
communities to your job specific problems.

If your problem can not benefit much from existing solutions, then Welcome!,
Python will provide you the means to solve your problem.

As you mentioned performance issues, allow me to notice that, indeed, you
can code in Python such as to beat MATLAB, but you will still lag behind
C/C++/Fortran. If speed is essential you should be prepared to consider your
Python code a prototype and translate it to a lower-level, optimized
implementation.

Very often, the < design&test with Python -implement with C/C++ > approach
it's still the fastest way to come with a solution.


ionel


PS
MATLAB currently (5.#) supports multi-dimensional, heterogeneous arrays,
data structures and even some form of OOP (actually, just function
overloading).







More information about the Python-list mailing list