Python is awfully close to being a superior (and free) replacement for Matlab, but there are a few annoyances that keep preventing me from switching forever. Unfortunately, these are mostly not bugs but bad design that is believed to be correct by the core developers, so it is unlikely to ever change: - Matrices are a pain. The r_[] and c_[] operators could be a reasonable replacement for Matlab's elegant matrix cons…
Why Python rocks for research
91–100 of 103 posts
Re: Why Python rocks for research
#92Earlier quoted context omitted.
SciPy, NumPy, Matplotlib, Cython, Sphinx, PIL. The article should've also mentioned NLTK. IMHO, languages matter less than the available libraries, and in my experience only Java matches the depth of the Python ecosystem. That Python is a nice language to work with, that's just a bonus.
I agree about Python's libraries. Normally, I'm a Ruby programmer, because I like Ruby's syntax and the Rack/Rails/Sinatra web stack. But if I need to do scientific or linguistic programming, Python is absolutely amazing. SciPy, NumPy, Matplotlib and NLTK support a rich and deep ecosystem. And it's vastly nicer programming environment than Matlab and Octave. (Of course, GNU R is also pretty useful if you're doing pur…
Re: Why Python rocks for research
#93Earlier quoted context omitted.
install is painful - enthought python distribution does make it pretty painless, but its not free for non-academics agreed on documentation actually I think python's visualization capabilities are more powerful, have you looked at mlab? the 3d capabilities there are insane I use python because I can do rapid prototyping, and turn it into a full application with the same code base. did you ultimately go back to matlab…
Well, I only got it all the work ( on OS X ) like an hour or two ago, and am currently happily learning&exploring. I wanted to venture beyond Matlab because for what I am currently doing the environment and language is to limited, yet I do not wish to prototype in C++. Python together with some libraries seemed to be a deal in heaven. I also thought it would function as a better stepping stone towards an actual appli…
Moving your development to a linux machine will clear up all of those issues.
Also 'easy_install' should get you all of the packages you want.
Re: Why Python rocks for research
#94> In MatLab everything is flat – all functions are declared in the global namespace. However, this discourages code reusability by making the programmer do extra work keeping disparate program components separate. In other words, without a hierarchical structure to the program, it’s difficult to extract and reuse specific functionality. I completely disagree. Reusable Matlab code has been my holy grail for the last c…
It's absolutely true that using more functions makes your code more maintainable. It's also absolutely true that nearly every other language on the planet does this better than Matlab.
Re: Why Python rocks for research
#95Earlier quoted context omitted.
What's your take on the multitude of software that you buy together with all the README files, Word or PDF documents describing how to use the software, what does it do, and all that jazz? Do we (humans) get to view all that code and see what Microsoft Office Word 2007 can do for us?
> Do we (humans) get to view all that code and see what Microsoft Office Word 2007 can do for us? Well, we should be able to, but no, we can't, precisely because we don't get code - we get binaries.
Or maybe not just yet.
Re: Why Python rocks for research
#96And the corollary: Why do researchers never respect the PEP8 when they write python code? Yes I am a bit overreacting since the blog post is very well written and I actually agree 100% with the content. But please people: respect the PEP8 [1]. It makes your readers feel at home while reading your code. It is very important if you want to get new contributors to your project. See [2] for instance. [1] http://www.pytho…
Re: Why Python rocks for research
#97This article makes some fairly convincing arguments that Python is a more flexible tool than Matlab or Perl, but I can't help but come away with the sense that the author hasn't tried many other languages. There are an awful lot of languages that provide iterators, a powerful set of data structures, extensive libraries and facilities for structuring and maintaining large codebases. .Net languages (maybe F# would be g…
Also, you want a non compiled language. Most of the time you do interactive programming and change parameters on the fly, according of the result of the analysis.
Finally, matplotlib, one of python's most complete graphic library, is a breeze to use. Making graphs in an interactive way with java or .net is simply impossible.
I am a neuroscientist and most people in the field use Matlab. I use python (in fact I use ONLY open source software, by choice). It's amazing how many advantages python gave me on my daily life.
Re: Why Python rocks for research
#98Earlier quoted context omitted.
The 80 chars limit has a justification: expressions that don't fit on 80 chars (or two lines using parens) are not readable anyway. In such a case temporary variables with meaningful names would both help respect the 80 chars constraint and make the expression easier to understand by the reader. Furthermore having 80 chars is great to have vertically split editors with the code on one panel and the tests or the docum…
> The 80 chars limit has a justification: expressions that don't fit on 80 chars (or two lines using parens) are not readable anyway I disagree. There are many cases, especially after 2-3 levels of indentation, where 80 characters is an unreasonably narrow space. I don't have a strong preference for reading code within 80 characters. And I'd much rather comments use 80 characters plus indentation rather than worry ab…
> I disagree. There are many cases, especially after 2-3 levels of indentation, where 80 characters is an unreasonably narrow space.
Some people would say that after 2-3 levels of indentation you should be looking at refactoring your code. Probably to pull something into a separate function/method.
Re: Why Python rocks for research
#99I've wasted most of my professional life tweaking various unix software to make it work. However, the typical scientific python setup proved to be too frustrating to install on OSX. The recommended solution is to just buy the Enthought distro. If I'm paying for software anyway, why is Enthought better than Matlab?
disclaimer I work for enthought I did my whole phd in matlab. EPD is much cheaper and is free for academics even if it weren't free, I would use it anyways. but it really isn't why is EPD better than matlab, it's why python is better than matlab. matlab is a domain specific application with a domain specific language. It doesn't work well with things outside of its domain. python is a general purpose language (And as…
Ah, you mean "Chaco" -- it's easier to find with the correct spelling. :) http://code.enthought.com/projects/chaco/
Re: Why Python rocks for research
#100Earlier quoted context omitted.
Thank you, that is the kind of response I was looking for. I will take a look at Enthought.
you WILL get frustrated by some things - some of the matrix concatenation operations are less convenient, some of the libraries are less polished, it's been worth it for me. msg me if you need help. use IPython, not just python shell for interactivity. also checkout 3d datavisualization with mayavi, that stuff is really awesome.
or bpython