?
Solved

Benefits of Python versus R

Posted on 2014-11-13
2
Medium Priority
?
269 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.
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 27

Accepted Solution

by:
d-glitch earned 2000 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

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 will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to dynamically set the form action using jQuery.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Suggested Courses

800 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