Data Warehousing and Machine Learning

31 December 2021

Why do we use Python in machine learning?

Filed under: Data Warehousing — Vincent Rainardi @ 9:02 am

Yesterday a friend asked me why we used Python in machine learning. He prefers to use Node.js for application development, and he can code in other languages too including C++.

I replied that we use Python in machine learning (ML) because:

  1. ML libraries such as Scikit Learn, Keras, XGBoost are mostly available in Python (some are available in R), and we need those libraries to build and train ML models.
  2. Code examples in ML are mostly in Python e.g. in Kaggle, OpenAI, Medium, Towards Data Science, Analytics Vidhya, ML Mastery.
  3. ML platforms like Colab, Dataiku, Google AI, OpenAI Gym, Data Robot, Azure ML use Python. Some use R but none uses Node.js.

And we both also observed that universities these days use Python more, compared to other programming languages. And ML courses such as Coursera, Udemy, Udacity too, they also use Python (again some use R but not as popular as Python).

Let me qualify some of the above remarks, with regards to R:

  • Keras and Tensorflow are available in R too: link.
  • You can use R too in Google Colab: link.
  • Dataiku code recipes are available in R too: link.
  • Databricks ML platform is available in R too: link.
  • You can install OpenAI Gym in R too: link.

So yes you can still do ML in R today. But it is a losing battle. More and more examples and academic papers are available in Python, compared to R.

And yes there is no chance for other languages, such as C++ or Node.js. We can’t use them in ML.

Change or Die

IT in general is a very dynamic world. It keeps changing. Particularly programming (development). I started programming when I was in 16 using Basic language. And dBase III+. In uni (around 19-23 years old) I mainly use Pascal and I learned C and Fortran too. I had difficulty to switch to Assembler, so I took a few months course. In uni I took a few odd jobs/projects, using ForPro and Clipper.

Then I joined Accenture (Andersen Consulting then) where I used Cobol and AS/400, C++, PL/SQL. Then I moved to UK (a company called Paxar in Harlow, now Avery Dennison) and used C#.NET and T-SQL. I then joined and used Java and PL/SQL. Then in the subsequent jobs I used MDX, T-SQL, Python, JavaScript and R.

Yesterday another friend asked me how did I change to Python in ML recently. I replied that I have jumped many times in the past, so the last jump into Python was not difficult. You can see above that I have jumped from one language to the next constantly. I said to my friend (he’s a SQL DBA) that the first jump, i.e. into Assembler was very difficult. But after that it was easy. I jumped into C#, Java, R and Python without difficulty.

And we will have to change again in the future. In the IT world, we have to constantly change. Not just in terms of languages, but also in terms of platforms. For example, we all had to change to the Cloud platform. SQL Server, my DBA friend said yesterday, moved to the Cloud. Ah yes, we all moved to Azure or AWS.

So yes, I’m afraid in the IT world we have to change, or we die.

Best Language for Machine Learning

I’ll close this article with this: there is a survey this week in Linked In about which language will be the best programming language for Data Science and Machine Learning in 2022 by Zakash (link). And the result is overwhelmingly Python (94%). Yes it is only 136 votes today (31st Dec, 9:15am), but click the above link to see the current result after a few days. I am sure it will still be overwhelmingly Python.

1 Comment »

  1. Thankyou for this – v interesting.
    But it begs the question: Why Python?
    What is so good about Python?

    Is it simply the most common language dominating through strength of numbers?
    Or is there something different/better about it? Like the interaction with libraries/packages.

    Comment by michaeldroy — 31 December 2021 @ 11:47 am | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at

%d bloggers like this: