When you are becoming aware of data science as a field you’re faced with the question of whether to learn R or Python. “Knowing” one of these languages seems like a key to the industry and choosing the right one to learn feels very important. My recommendation is to learn Python first. I’ll give my background and the reasons for my recommendation.
I taught myself R after college, using tutorials to work on little analyses. It was difficult and I had a few false starts where I got frustrated and stopped for a while but after a few weeks of consistent work I got over the initial hump and things made sense enough that it became fun. I kept working in R, doing most of the analyses on my website using it, and mostly webscraping and data cleaning and visualization.
Then I got a full-time job in analytics and while I could use R there, the data science team mostly used Python and there were lots of Python scripts that automated analyses and moved data from one system to another. Lots of these tasks would be much, much harder in R, which is positioned as more of a pure stats and analytics language.
Since then, I’ve learned Python, both from colleagues and from online resources. I now mostly automate tasks, scrape data, and write repeated scripts in Python. If I have a clean dataset and want to visualize it beyond very basic plots, I’ll use R.
R is better for exploratory data analysis, for quickly looking through a relatively clean dataset and understanding it and for data visualization. You can make nice-looking, shareable plots in R without much code.
But Python is much more versatile, and it is much better for automating repeated tasks that don’t only involve data analysis. When you are starting out, you don’t know exactly what sort of data work you will be doing and getting good at Python gives you the most optionality.
Lots of the data work that needs to be done at companies is what people call “data engineering,” setting up pipelines to clean and move data from one system to another and automating that, and Python is much better than R at this. You can also use Python as a base to get into other type of software engineering which will be valuable to you or an employer; R is harder to do with this.
You can see from this ranking of programming languages just how big a lead Python has. And while it is much closer in the field of data science, I think that the two are comparable enough in that field that you might as well give yourself the added power of knowing Python when you’re starting.

Getting started in Python might be a little bit harder, but a week or two of extra work at the beginning of your career is not a big enough factor to let it influence your decision.
Python is powerful enough that its relative difficulty pays off. And you can always learn R later if you feel so inclined; learning one after you learn the other is much easier than learning from scratch.
The only exception is that R has a very inclusive, kind community, more so than Python in my experience. If this is important to you as a beginner and you would like to actively engage with the community of other users, you should choose R.
Both languages are great and whichever you choose to learn first, you can always learn the other later. But knowing what I know now, I wish I would’ve started with Python, and I’d advise you to do the same.
