The world’s leading publication for data science, AI, and ML professionals.

R vs Python, let’s frame the answer better.

This questions seems to linger and the blogs I have found don't seem to help people make a choice. Let's frame the answer better!

Despite multiple articles written about this topic, very few offer arguments that help people choose.

Image by Darby Browning from Pixabay
Image by Darby Browning from Pixabay

This question seems to linger and there are endless articles trying to help people choose the ‘right language’ for data analytics and Data Science. From my perspective, none of the articles I’ve read are helpful. Most include:

  • A historical introduction about the creator of each language – although interesting, it doesn’t help in making a decision.
  • An extensive comparison including differences like Python is an object oriented Programming and R is a functional language. This does not mean anything to someone new to the field. And regardless, it’s irrelevant. It’s like comparing the purpose of the Spanish language vs the English; does knowing these differences help you choose?
  • A demonstration of what the code looks like, often comparing it’s length and the time it takes to execute the code. Often the conclusion is that for some things one language takes more lines of code and in other situations the opposite happens, while the difference in time of execution is often in seconds. But neither of these things are significant. If you knew that the longest German word is 42 letters compared to the Spanish one which has 32 letters, will this help you chose a language?
  • A graph showing the most common languages, were Python appears much higher on the list. And rankings like this which often put Python at the top. This is misleading because programming languages are used for more than just data science, and Python can be used for software development which is why it appears to be more popular, as it’s kinda like a swiss army knife.
  • Learning curve comparisons in which, depending where you read, the answer is either Python or R that is much simpler. But the decision shouldn’t be based on simplicity rather on purpose.
  • And my favorite is the conclusion that learning both doesn’t hurt because it’s better to have more skills. I can see the appeal in knowing more languages but this doesn’t help to make the first step.

This was a useful article because the author analyzed job postings and the words most often associated with R and Python. The biggest conclusion is that if you want to work in research it’s best you learn R. This makes sense as R was developed by statisticians so any jobs that require extensive analysis and research use this language. Python in contrast was developed by a computer scientist. Although this tip is useful, technology has advanced and there are ways to collaborate when coding in different languages. And even more, here is a list of companies that use R (includes Facebook, Amazon, Google who also use Python, so R is not only used in academia).

To sum it up, none of this information actually helps in making a decision because every time you think one language can’t do something, there is already a solution put forward as the industry advances.

I learnt R first but it wasn’t because I had a choice. Back in 2018, the only bootcamp in Barcelona that was teaching data science taught in R and RapidMiner. A year after I graduated, AllWomen and Ironhack launched their data science program. Both teach Python, following suite of well known academies like General Assembly, LeWagon, Metis, courses like the Nanodegree by Udacity, the Masters in Big Data at the Universidad de Barcelona, Kaggle’s courses which teach in Python and many others.

I wrote the data science curriculum that launched the program at AllWomen and chose to do it in Python. I learnt it on the go which wasn’t difficult because I knew what I was looking for. And I made this decision because everything I found in the data science world promoted Python, including Meetups like PyLadies BCN who were actively organizing meetups compared to RLadies BCN who were not running events back then. Even jobs in R for a junior position were difficult to find (I am talking about Barcelona and Europe).

My advice, and something that resonates in this blog, is that you should choose the language that your community speaks so you have a support group and don’t feel disadvantaged. And once you learn that language you can spend time adding the other to your skill set if you need it and are curious.


I ran an event at AllWomen in 2019 where we discussed this very question. I did fall into the pattern of comparing these languages into the most traditional way until I found Reshama Shaikh‘s work Why women are flourishing in R but lagging in Python. Here are the slides if you want to take a look. They are licensed under the Creative Commons Attribution-Share-Alike which means you can do anything with the slides as long as you give me credit.


Related Articles