Live data from Hacker News

Why Python rocks for research

stat.washington.edu

21–30 of 103 posts

Re: Why Python rocks for research

#21
Python is good, you could also consider Maxima.

A single example:

f(x):= x^2+3x+7;

Maxima provides: Symbolic computation, blas and laplack integration for numeric algebra, 500 pages manual in several languages, a complete library for statistics, differential equation, calculus, series. Graphics with matplotllib. Also maxima language is not much complicate that python:

for i in range(10):print ii versus for i:0 thru 9 do print ii;

[i2 for i in range(10)] versus makelist(i*2,i,0,9)

But Matlab libraries are greater than python and maxima.

Re: Why Python rocks for research

#22
post #10

Earlier quoted context omitted.

I only scanned the article very briefly, but my impression is that the important comparison is vs. Matlab. The other players aren't really in the author's game. It's a question of the use case and the community and the library support. In theory, .Net could displace Matlab or Python as the canonical platform for scientific researchers. And in theory Python could displace PHP as the canonical platform for classic CRUD…

I've been a Matlab user for 10 yrs, recently switched to python because of the increased flexibility. never going back to Matlab ever again. Python math and science libs can be a little rough around the edges, but the flexibility more than makes up for it for me.

I'm a Matlab user myself, but I try to use Ruby whenever possible if for nothing else but to just get away from all the god damned matrices. I didn't realize Python had similar capabilities, I look forward to trying it out. But does Python have "Index exceeds matrix dimensions." errors? I just can't imagine life without seeing a few of those every day. That said, the workspace is really handy, is there some equivalent GUI in Python?

Re: Why Python rocks for research

#23
post #12

And 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…

I don't think most researchers ever expect anybody to read their code. Woe to the graduate student who years later actually needs to use the code.

Re: Why Python rocks for research

#24
post #2

I learned Python on the fly specifically for research. I used Django to build out an enterprise reporting/analytics system to support a customer experience (survey) program for the cost of time (huzzah open source). We had bids on this project upwards of 80k. We generate ~100k surveys / month and are able to get targeted, meaningful, automated insights directly to front-line management. Python FTW.

Python + Django FTW.

Re: Why Python rocks for research

#25
post #22
post #10

Earlier quoted context omitted.

I've been a Matlab user for 10 yrs, recently switched to python because of the increased flexibility. never going back to Matlab ever again. Python math and science libs can be a little rough around the edges, but the flexibility more than makes up for it for me.

I'm a Matlab user myself, but I try to use Ruby whenever possible if for nothing else but to just get away from all the god damned matrices. I didn't realize Python had similar capabilities, I look forward to trying it out. But does Python have "Index exceeds matrix dimensions." errors? I just can't imagine life without seeing a few of those every day. That said, the workspace is really handy, is there some equivalen…

Check out EPD: http://www.enthought.com/products/, particularly the ETS framework. It contains almost all the popular scientific/numeric libraries in python and is free for academic use (and much of it is open-source).

(disclaimer - i work for Enthought).

Re: Why Python rocks for research

#26
post #16
post #14

Earlier quoted context omitted.

Yep, same with me. I do prefer Ruby, but it's just not feasible at the moment. Languages that get behind in a certain area enter a terribly vicious circle: There's no scientific community backing Ruby, so why would I develop something that'd make Ruby more competitive?

I'm in the same boat and it seems like several others as well. I'm fine moving to Python for the moment, but I wonder how the Ruby community will ever know if there's enough of a demand for scientific tools to merit their development?

I prefer Ruby generally, but honestly Ruby and Python are sufficiently similar that I'd rather smart programmers put their time to good use doing something other than reimplementing Python's science libs.

I think that making some tools available in a totally different language (maybe something functional) would be much more useful, because it would allow for a very different approach to the problem if needed.

In a perfect world, we could also have the option of using light wrappers around OpenCL matrix libraries, and push the linear algebra to GPUs that eat matrices for breakfast.

Re: Why Python rocks for research

#27
post #23
post #12

And 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…

I don't think most researchers ever expect anybody to read their code. Woe to the graduate student who years later actually needs to use the code.

That must change. Science must be reproducible. Other researchers should be able to dive into each others code quickly to understand the impact of implementation details.

Re: Why Python rocks for research

#28

Python is good, you could also consider Maxima. A single example: f(x):= x^2+3 x+7; Maxima provides: Symbolic computation, blas and laplack integration for numeric algebra, 500 pages manual in several languages, a complete library for statistics, differential equation, calculus, series. Graphics with matplotllib. Also maxima language is not much complicate that python: for i in range(10):print i i versus for i:0 thru…

Maxima rocks for symbolic math. I prefer it to Mathematica, which is saying a lot. In contrast, octave always feels like "almost-Matlab" and I still prefer the latter.

Also see wxMaxima, which will (among many other things) produce LaTeX for you.

Re: Why Python rocks for research

#29
post #27
post #23

Earlier quoted context omitted.

I don't think most researchers ever expect anybody to read their code. Woe to the graduate student who years later actually needs to use the code.

That must change. Science must be reproducible. Other researchers should be able to dive into each others code quickly to understand the impact of implementation details.

Well yes and no, if they're doing their job right they describe the method in such a way that you don't need their code to reproduce their results.

Code should not be Documentation.

Further nobody trusts anybody's code anyway unless it's just a couple of trivial calls to a pre-vetted software package like IRAF, AIPS (to name some astronomy related one), or LAPACK. So generally they don't want your code. the exception is grad students trying to apply your old work to new data because they aren't in a position to be trusted with completely original research yet.

Yes it'd be nice if every one had great readable code and handed over the 2 terabyte data sets that it needs without batting an eye. but in practice code quality is pretty low on the ladder of "things that get in the way of collaboration"

Re: Why Python rocks for research

#30
Often languages are chosen based on already existing tools used in a specific research project. That's why it's good to be able to quickly pick up new languages. For example scripting languages integrated in some frameworks, like Scheme in the Festival speech synthesis system. In the end, this often results in projects involving things like Python, Scheme, bash, R and a bit of tcl ;-).
Post reply on HN