Choosing between R and Python: A Digital Analyst’s Guide

A classic line from Father Ted, the Channel 4 comedy series from the 90s, filmed in Ireland.
  • It doesn’t matter which one to learn — because both languages are great
  • Why not learn both? — because that’s always better than knowing just one
  • Decide yourself — based on your own field and interests

R and Python in digital analytics

“A song for Europe”
  • The similarities. I have done no statistical analysis to support this, but empirically for over 90 % of the analytical tasks in digital analytics, R and Python have equivalent functionalities and capabilities. For example, for the common task of importing, transforming and exploring data, simply comparing the equivalent R/Python code can make the similarities in logic and expression between the two fairly obvious.
  • The differences. It’s true that there are some conceptual differences between the two languages, e.g. Python is primarily object oriented whereas R is primarily a functional programming language. These differences however are hardly noticeable for the most common digital analytics tasks.

Advantages of R

  1. The human interpretability factor

Advantages of Python

So, which language should a digital analyst choose?

“My lovely horse”
  • Data analytics at scale. Sometimes preparing an ad hoc analysis — using R as described above for example — is perfectly suitable for most processes, but it might not be the optimal option if you have to automate and scale it at a later stage. For example, your organisation might decide to develop infrastructure to run A/B tests at scale or to use the results of an ongoing analysis in order to improve the customer experience in real time. Python is typically the preferred language for this kind of use projects.
  • The swiss army knife language. There’s also the type of analytics professional who prefers to move beyond the realm data analysis and use programming skills to accomplish a variety of other tasks such as web crawling, natural language processing, developing web apps or automating various other tasks. Python is a powerful general purpose language, which in fact some programmers refer to as their “swiss army knife”. As such it is recommended for the above use cases, many of which fall within the broader data science area.
  • Machine learning. Machine learning and AI in the digital analytics world is currently something that mainly happens behind the scenes at the side of the platform providers, Google, Adobe etc. rather than in-house. But if there is scope for machine learning in your organisation for it to become a significant part of your role, then Python with scikit-learn is a premier language in this field. It offers a very solid and consistent API for machine learning work which has evolved into an industry standard toolkit.

Closing thoughts

Read more on Data Science and AI:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store