Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

This question already has an answer here:

Just read a presentation about using Python for Scientific Computing. I am currently using MATLAB (student license FTW, which will expire when I graduate soon).

So I was wondering how matured SciPy and NumPy are with respect to relying on them for all the Scientific Computing I need to do. The advantage is that it's free. I am mainly focused on Signal Processing, Audio, Acoustics kind of computing.

I can imagine that the NumPy and SciPy projects are evolving with respect to the support for more complex techniques. So, how fast are they evolving, are there large communities behind them?

Finally, are there other solutions?

share|improve this question

marked as duplicate by gnat, Martijn Pieters, Robert Harvey, Jimmy Hoffa, Joris Timmermans May 15 '13 at 7:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

if that presentation is online, can you point me to it? Thanks. –  temptar May 9 '11 at 9:49
NumPy and SciPy are mature. Matlabs lacks many things that Python has. Why not have them both? The syntax will remain 95% the same. vetta.org/2008/05/scipy-the-embarrassing-way-to-code –  Job May 9 '11 at 12:27
@temptar lac.linuxaudio.org/2011/download/… –  notthetup May 9 '11 at 15:42
thank you very much. –  temptar May 9 '11 at 15:45
I also just found out about Julia.. Which is something I'm gonna try out next.. julialang.org –  notthetup May 15 '13 at 3:01
add comment

5 Answers

up vote 4 down vote accepted

In short: Python is a much better language than Matlab, and has more complete general-language features, but Matlab has a more complete set of scientific computing tools than Python.

Octave also has more complete scientific tools than Python, and is a closer language to Matlab if you're already familiar with it, but also shares the language's flaws. Octave and SciPy are free, Matlab is very not free.

I am mainly focused on Signal Processing, Audio, Acoustics kind of computing.

Me too, and I've found SciPy lacking. Some examples:

  • Documentation is poor or non-existent for many functions
  • Filter design tools convert to transfer function representation internally, so higher-order filters suffer from numerical error problems. (fixed)
  • Other functions like freqs only accept tf representation, which, again, causes numerical error problems.
  • Doesn't support filters in second-order-sections representation
  • FFTs are not as fast
  • Lots of functions from Octave/Matlab don't exist yet in SciPy, and can't be directly translated from Octave because of GPL vs BSD licensing
  • ...

But I still prefer SciPy, because the language is much nicer to use, and does most of what I need. It's free and open-source, and actively developed, and you can contribute easily just by pushing "Edit" on Github. Since I'm primarily using this to learn and practice signal processing, I don't consider it a problem that I have to contribute documentation (old vs new) or improvements myself. That's the sort of thing I want to learn anyway.

Also, while in the process of trying to fix some of these things, I've uncovered some flaws in Matlab's filter design tools: 1 2 So open-source development with lots of test cases has its advantages, too.

share|improve this answer
add comment

You should look into Sage; it is the open source alternative to Matlab, Mathematica and others. The core language is python, so you can use all python libraries natively, and it has bindings for most free and non-free mathematical software so you can use Matlab, Mathematica and others inside it. It has a lot of support from within the mathematical community and its lead developer is very highly thought of and committed to the project.

share|improve this answer
Thanks!! I will look at it!! –  notthetup May 9 '11 at 15:32
Sage is just a wrapper for lots of other tools. Unless you're doing advanced mathematics, you're probably better off using those tools directly. –  endolith May 14 '13 at 13:54
(I was referring to things like andrejv.github.io/wxmaxima rather than using maxima through sage, which is much clunkier) –  endolith Apr 18 at 2:06
add comment

Under the "Other Solutions" topic: Have a look, also, at Octave and SciLab. These are usually close enough to Matlab to make translation of scripts fairly painless.

However, moving to Python seems like a good idea, too! There seems to be some work on integrating with Python in SciLab.

share|improve this answer
Cool!! Thanks for the feedback! –  notthetup May 9 '11 at 15:42
You didn't mention their price, and sometimes it is quite important. Other then that, their capabilities are quite good. –  BЈовић May 14 '13 at 18:37
@BЈовић: The price of Octave and SciLab? Free! –  Peter K. May 15 '13 at 7:35
@PeterK. I know they are free :) You didn't mention it in the answer. –  BЈовић May 15 '13 at 9:37
add comment

Also under "other solutions":

I'm very much on the Python-for-science bandwagon, but my free/open source "I don't have a Matlab license" substitute often ends up being R instead.

I find it somewhat frustrating syntax-wise (indices start at 1? assignment is done "varname <- value"? Come on ...), but it is fairly ubiquitous at least in my scientific discipline, ecology, where scientists may not be generally programming-literate (& hence bewildered when I send them a Python module), but do use Matlab/R-type statistical packages - I have ported Matlab code to R for signal processing-type applications (not personally for audio in specific, but I do know bird researchers using it for that).

share|improve this answer
Interesting.. Good to know!! :) –  notthetup May 11 '11 at 6:56
@ntt - if this is at all interesting/useful, you mind giving it an upvote? Thanks :) –  Beekguk May 11 '11 at 19:39
Yup!! hahaha.. Hard to choose an 'answer'.. But thanks for all the feedback.. :) –  notthetup May 12 '11 at 15:56
add comment

Python with SciPy/NumPy is a pretty mature platform for scientific computing.

The one place where arguably it's pretty weak is upper level statistics - I haven't been terribly impressed with the offerings in that area, and despite my deep love for Python have not adopted it as a statistics workbench at all. The good news is you can get around this by calling R from Python.

With the addition of R (or another statistics language - the only other one I'd consider unless you really had a specific requirement would be SAS, and that's pricey), the combination of the two is a very solid, open-source and actively developing platform. R does work a little bit differently than most programming languages, because of a slightly different philosophy. It's designed for how statisticians think, rather than programmers. Hence things like indices starting at one - that's often because that's also "Subject 1", "ID0001" etc.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.