Solved

Benefits of Python versus R

Posted on 2014-11-13
2
223 Views
Last Modified: 2014-11-19
I’m refactoring someone else’s code that’s been written half in Python and half in R. The core purpose of the code is discriminate analysis. Of course, I think it would be clearly beneficial for performance if only a single language was used, and I’m trying to make an argument one way or another.

The two common areas of debate between R and Python are speed and differences in algorithms (and thus mathematical accuracy). In addition, it’s my understanding that R was chosen from the belief that the validity of the analysis would be more defensible (scientifically) if it were done in R.

So, I’d love some input on two ideas:

1.      In a (specifically) discriminate analysis environment, would R be more defensible (and why)?
2.      In a (specifically) discriminate analysis environment, in what analytical/mathematical ways is R better than Python?

I really appreciate anyone taking the time to respond to this.  

Best!
0
Comment
Question by:Mike R.
  • 2
2 Comments
 
LVL 27

Accepted Solution

by:
d-glitch earned 500 total points
ID: 40441737
Presumably you mean discriminant not discriminate.
     http://www.jmp.com/support/help/Discriminant_Analysis_2.shtml#65479

This topic is covered extensively on line.  This is just one of the threads from Googling "Python vs R"
     http://www.quora.com/Which-is-better-for-data-analysis-R-or-Python

Python is a general purpose interpreted language.
R is also an interpreted language which is targeted at statistical analysis (your application).

I wouldn't worry much about numerical accuracy.  The respective communities are sure to be vigilant.
Speed is apt to be a toss-up as well.  Check the published bench marks for each language.

Community acceptance might dictate a choice of R over Python.  Check with the editors of Journals in your field or scan some recent issues.  And even that decision could be wrong by next year.

One last (frustratingly unhelpful) note:  The hybrid combination of R and Python may be the right choice.
     http://www.r-bloggers.com/python-compliments-rs-shortcomings/
0
 
LVL 27

Expert Comment

by:d-glitch
ID: 40448208
Several criteria can be used to justify the choice of a particular language:

Exigency:  If the project is incomplete, and needs to be completed soon, use the language you know best.

Authority:  If external authorities require a particular language, use it even if there is a learning curve.

Expediency:  Use a combination of languages if that gets the job done fastest.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever thought of installing a power system that generates solar electricity to power your house? Some may say yes, while others may tell me no. But have you noticed that people around you are now considering installing such systems in their …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now