Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should i switch to Python? [closed]

I recently have been considering switching to the Python programming language. Currently, Matlab is the language of choice in my department for rapid development and prototyping of code. It’s very good at this, but Mathworks (the company who produces Matlab) have been tinkering with the licencing terms, leading to hassles where none should exist.

like image 894
ssutton2 Avatar asked Feb 21 '11 06:02

ssutton2


2 Answers

I have found python+numpy+scipy+matplotlib+IPython+[random sci/numerical packages] to be almost a complete replacement for matlab. There are certainly some packages missing, so if there is a specialized set of tools that are available in matlab but not in python, this might be an issue, but otherwise, I haven't looked back.

I'll mention a couple of distinct advantages of python over matlab

  • True programming language instead of a hack of a language thrown over a numerical package (numpy came to python instead of the other way around). Managing large python projects is a complete joy vs matlab. How many different oop systems have been mangled into matlab?
  • Totally free and portable. I can use python on just about any machine without licensing issues. This is the biggest advantage from my perspective.
  • Wrapping other libraries in C,C++, Fortran is fairly straightforward using SWIG, Cython,f2py,etc vs the ugliness that is a mex file
  • Cython for accelerating slow code (although I find that numpy is nearly as fast if not faster than matlab)
  • mpi4py vs some other package that I have to buy from matlab to run parallel applications

Personally I use the Enthought Python Distribution for a lot of my work, because it packages everything and is free for individuals in academia. I've alternatively built python and all of its libraries and modules from scratch. Module management is perhaps the largest weakness in python, but there are some nice things to help out like virtualenv and pip

like image 55
JoshAdel Avatar answered Sep 24 '22 00:09

JoshAdel


The choice comes down to cost. If you are happy paying for Matlab - especially if you use the toolboxes - you will likely find Python doesn't provide such an integrated package. Having a matrix as the basic data type makes Matlab an intuitive language for many mathematical tasks. Personally, I find the this coupled with the debugger invaluable.

Python, through NumPy, SciPy and the like do provide the same functionality. There will of course be a learning curve to overcome.

If you are performing general programming tasks, that are not particularly applied math solutions then Python is an extremely easy to use and adaptable language. It is also free - which may be a deciding factor.

like image 20
josh Avatar answered Sep 24 '22 00:09

josh