Speed : Python vs R vs other languages for data science? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Speed : Python vs R vs other languages for data science?

I was just wondering why nowadays Python is so famous for Data Science, Machine Learning,...? I heard that it was high level programming language compared for example to C or C++. Therefore in a context of big data and complicated machine learning algorithm, where speed of execution becomes important, would'nt it be more efficient if we were writing programs in low level language? Moreover, in a term of speed of execution, how is Python situated compared to other software like R or SAS? Thank you a lot.

22nd Apr 2017, 7:02 PM
Christian Tchou
Christian Tchou - avatar
2 Answers
+ 9
It mostly depends on the complexity of algorithm you apply and modules/libraries you use. Both R and Python are interpreted languages of comparable speed. If using only their primitive data types, it will take ages to handle the data. But apply dplyr or pandas, respectively, and things speed up thanks to optimization techniques. BTW, it would of course be more efficient to write everything in C++. But both Python and R save heavily on the time needed to write, implement and actually run the code - this is their true (or True ;) advantage over compiled languages. Also, the assumption is you rarely deal with repetitive, predictable data streams. Most often you have to write something quickly and implement it on the go, rather than compiling it. You probably won't need it again or will alter it extensively - no need to compile, but a very urgent need to run and get it going :)
22nd Apr 2017, 7:26 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
0
Christian Tchou I challenged you in python. Do you mind if you accept it?
12th Sep 2018, 6:55 AM
Saeed Mozaffari
Saeed Mozaffari - avatar