Python or R

Featured image

I. Comparison

As stated in the previous article, programming plays a crucial role in a Data Scientist’s Toolbox. But there are sooooo many languages out there, how would you decide what to learn?

Wandering around google with the keyword “data science programming language”, you must have noticed that Python and R outweigh the rest for their support for data science tasks (statistics, machine learning, etc.). So the question of what programming language to use can be narrowed down to “Python or R”.

Both have great packages to support you with your data science task, and each come with its own strengths. There has been a lot of articles on Python and R, their differences and advantages over each other. Below is just some main points (personal experience included) to guide you through your selection. A detailed comparison will be provided at the end of this section.

1. Simlilarity

2. Difference

Python is a general purpose language, ranging from web development, web app, etc., whereas R is mainly used for statistical task. From my viewpoint, there are 6 main points that can help distinguish the two programming languages, which are: speed, community support, job opportunity, visualization, statistics and deep learning. The order is chosen from basic concepts to complicated ones.

So in my opinion, R is a better tool for data science. Python is cool too, but it is just too slow to fit my need. But what do I know :D All in all, as both have their own strengths, the result boils down to what language fits your need, not to compare one is better or another. The two languages are absolutely cool and nice to know as a Data Scientist. Some tasks will be more efficiently done in R and some should definitely be done in Python.

As an advice for you guys, I would highly recommend learning Python first, as its learning curve is pretty flat compared to R. Python’s syntax is also very easy to read, compared to R. So if you choose python as your first language to learn, your life would be much less painful.

For a detailed look at their pros and cons, you can access the infographic made by DataCamp here.

II. Installation

For personal reason, I usually use base Python/R together with an Integrated Development Environment (IDE). Using IDE, you will be provided with the benefits of: code editor, compiler, debugger, smart code completion. Sound cool right? But as these IDEs run on top of base R/Python, you know what you have to do first right?

1. R

2. Python

Same logic is applied for the installation of Python. However, the installation can be a little bit trickier.