8

Which one among the two languages is good for statistical analysis? What are the pros and cons, other than accessibility, for each?

  • Define "statistical analysis" and likewise for "data analysis". Both terms encompass huge amounts of territory and over much of *neither* matlab nor python are going to be clear winners. I do my "data analysis" in ROOT. There are many people on SO who do statistics in a big way, often using R. – dmckee --- ex-moderator kitten Sep 25 '10 at 04:16

5 Answers5

7

MATLAB

  • Good for beginners
  • Good for interactive sessions

Python (with SciPy)

  • Good for slightly experienced programmers
  • Good for creating reusable applications
  • Good for reading and exporting data files
  • Free of cost

If SciPy doesn't provide all the functionality out of the box, then you may have to go searching on the Internet. I am not an expert on geostatistics, but here is a mail with some starting pointers. http://mail.scipy.org/pipermail/scipy-user/2007-November/014434.html

I also heard that Python + R is good, but I haven't tried it.

Cris Luengo
  • 55,762
  • 10
  • 62
  • 120
nielsle
  • 381
  • 1
  • 10
  • Thanks nielsle. Great answer. Can you tell what do you mean by the combination of (python + R)? –  Sep 25 '10 at 06:19
  • 2
    Thanks.. and good luck :). By the way I probably made the differences look a little sharper than they really are. You can write complicated programs in Matlab, and python is a fairly good language for beginners. Furthernore python does provide interactive sessions. – nielsle Sep 25 '10 at 06:39
  • 2
    I object to "Slightly prettier graphs". Matplotlib produces equally pretty (often even prettier) graphs than matlab. With Matplotlib, you can even embed mathematical formulas with latex-like syntax, which matlab is unable to do. – OTZ Sep 25 '10 at 07:07
  • Fair enough. I'll remove the item. – nielsle Sep 25 '10 at 07:12
  • 3
    @OTZ: MATLAB does have a LaTeX interpreter: http://www.mathworks.com/help/techdoc/ref/text_props.html#f68-591188 – Amro Sep 25 '10 at 15:36
  • @nielsle: You mention R. I have used it and I feel like it's about halfway in between Matlab and Python. It's free and closer to a "real" programming language than Matlab, but it's still very strange-looking and hard to use if you're used to general-purpose languages. – dsimcha Sep 26 '10 at 20:44
6

The SciPy and NumPy libraries for Python add in a ton of MatLab-equivalent functionality, to the point where it might very well have surpassed MatLab as a scientific-computing resource.

As a language, I'd say Python is (in my opinion) far superior - function definition, imports, et cetera are all a lot nicer to work with than MatLab's more primitive equivalents.

That said, there is a lot of pre-written MatLab code out there for analysis, given that it was such a mainstay for such a long time.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Amber
  • 507,862
  • 82
  • 626
  • 550
3

I would pick Python because it can be a powerful as Matlab but is free. Also, you can distribute your applications for free and no licensing chains.

Matlab is awesome and expensive (it had a great statistical package) and it will glow smoother than Python in the beginning, but not so in the long run.

Now, if you really want the best solution then check out R, the statistical package which is de facto in the community. They even have a Python port for it. R is also free software.

Escualo
  • 40,844
  • 23
  • 87
  • 135
3

You should definitely check out Sage, it is a pre-integrated Python and many of the major maths/science oriented libraries and frameworks. From the website:

Mission: Creating a viable free open source alternative to Magma, Maple, Mathematica and Matlab.

Gaius
  • 2,556
  • 1
  • 24
  • 43
2

SciPy, NumPy and Matplotlib.

OTZ
  • 3,003
  • 4
  • 29
  • 41