Solved

Benefits of Python versus R

Posted on 2014-11-13
2
228 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Swadhin
Introduction of Lists in Python: There are six built-in types of sequences. Lists and tuples are the most common one. In this article we will see how to use Lists in python and how we can utilize it while doing our own program. In general we can al…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

862 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

25 Experts available now in Live!

Get 1:1 Help Now