Python vs R: don’t pick based on a coin flip!

Take a well-informed decision and pick the right language.

Anmol Tomar
CodeX

--

Shall I choose Python or R for learning data science? This is a question that almost every aspiring data scientist has when he/she is starting on the data science journey. In this blog, I will try to help you decide(if haven’t already) which programming language would be right for you!

R and Python both programming languages are used in the field of data science. There are some areas in which one of them is better than the other. You might have to learn both of them over the course of your career but still, it is important that you start your journey with the right language.

If you can answer the following questions(in priority order high to low) then you can pick the right language (Python or R) for yourself!

Q1: Which language do your friends/Colleagues work with?

It is also an important factor in choosing the programming language for Data Science. Picking the programming language which your friends/teammates use for data science will be handy due to 2 reasons :

  1. You will easily be able to work in collaboration with your colleagues on the same tech stack.
  2. You will be able to pick the language very quickly.

If this question is not relevant for you as you don’t have friends/colleagues then focus on the next question.

Q2: Do you want to learn it for academia or industry?

A lot of statistical research is done in R as there are a variety of statistical models to choose from, so in academia, R is a clear choice. Within the industry, however, of late Python has gained more traction than R because Python is a full-fledged programming language and thus can be used to create production-ready applications in which python-based models can be easily packaged.

Q3: Do you want to learn “Deep learning”?

Deep learning is a class of Machine learning algorithms that tries to mimic the human mind (neurons), learning by observations, for performing specific tasks.

The majority of the research in Deep learning is done in Python, using Keras and Pytorch frameworks. So, if you plan to learn deep learning sometime in the future then getting comfortable in Python would be beneficial for you.

Q4: Is creating beautiful Data Visualization the focus of your work?

R provides some great data visualization (ggplot2, leaflet) and dashboarding (using R Shiny) packages using which you can create beautiful visualizations. Python, on the other hand, lags behind a bit in this aspect as matplotlib is not a great visualization package(plotly is a good alternative). For creating a dashboard in python, Plotly Dash is a good alternative, you can check out my course to learn more about this.

Still not sure which one to pick, then keep reading!

Let’s look at some trends to understand which one is more popular and has more job opportunities :

1. Popularity

What does Google Trends say? Before 2016, R had more searches related to Machine learning and data science as compared to that in Python. This trend changed significantly after 2016 and Python became very popular over time.

2. Job Opportunities

The chart below shows the percentage of jobs related to data science for the two programming languages. Python(in yellow) has almost twice job posting as compared to R(in blue).

My Suggestion

As python is more popular, is a full-fledged programming language, and provides more opportunities, I would recommend you to start with Python and if in the future you feel that there is a need to learn R then you can pick that up later.

If you are picking python for starting your data science journey then you can check out my course for Udemy certification. You can avail 70% discount by using the following link : https://bit.ly/3148Qq6

--

--

Anmol Tomar
CodeX
Writer for

Top AI writer | Data Science Manager | Mentor. Want to kick off your career in Data Science? Get in touch with me: https://www.analyticsshiksha.com/