Python Vs R

Anyone interested in Machine Learning often face this dilemma, which language to learn for Machine Learning: Python or R? If you already know at least one of this language, you are ahead of so many! I dont know either. As an economist I am well trained in Stata, SAS and Eviews; but not in Python or R. Many of us could be in same situation like me. By the way, SAS has a data miner app (SAS Enterprise Miner) that can be used for machine learning too. I am bit familiar with Matlab and it has very powerful and GUI machine learning app as well. Both of these software’s are very expensive, not viable for many students.

I prefer to go with Python or R: they are free, open source, very strong and active community where you can get most of the problems solved very easily. But these are not as user friendly as SAS or Matlab. I will update a list of pros and cons for each here.

Difference between R and Python

ObjectiveData analysis and statisticsDeployment and production
Primary UsersScholar and R&DProgrammers and developers
FlexibilityEasy to use available libraryEasy to construct new models from scratch. I.e., matrix computation and optimization
Learning curveDifficult at the beginningLinear and smooth
Popularity of Programming Language. Percentage change4.23% in 201821.69% in 2018
Average Salary$99.000$100.000
IntegrationRun locallyWell-integrated with app
TaskEasy to get primary resultsGood to deploy algorithm
Database sizeHandle huge sizeHandle huge size
IDERstudioSpyder, Ipthon Notebook
Important Packages and librarytydiverse, ggplot2, caret, zoopandas, scipy, scikit-learn, TensorFlow, caret
DisadvantagesSlow High Learning curve Dependencies between libraryNot as many libraries as R
  • Graphs are made to talk. R makes it beautiful
  • Large catalog for data analysis
  • GitHub interface
  • RMarkdown
  • Shiny
  • Jupyter notebook: Notebooks help to share data with colleagues
  • Mathematical computation
  • Deployment
  • Code Readability
  • Speed
  • Function in Python


Final verdict: If you want to learn only one language for machine learning, it is Python!