6 ms·
The main issue I've had is speed. As soon as you have problems that can't be vectorized, models that take 30 hours to run in R take 30 minutes in python.
by ourlordcaffeine 4y ago
The main issue I've had is speed. As soon as you have problems that can't be vectorized, models that take 30 hours to run in R take 30 minutes in python.
- yarky 4y agoMind giving an example ? The only time I faced this was due to an autoregressive model, which was super easy to delegate to c++. I've been working with Python for the last year and appreciate how much it helps with general IT problems, but I would still stick to R for statistical/data analysis.
- CornCobs 4y agoIn my limited experience, problems that cannot be vectorized really shouldn't be written in python either (assuming you mean python loops). But indeed the edge that Python has is the ease of use of drop-in solutions like Numba allowing you to continue to write in Python but not Python
- 1980phipsi 4y agoIn both languages, you can write/use C extensions.
- ekianjo 4y agoyou can insert C code very easily in R for when you need more speed.
- mellavora 4y agoExample, please? This seems highly unlikely, based on my 20+ years with R. Yes, using wrong data structures/algorithms can lead to slow code, but switching languages won't fix this. rprof and microbenchmark are your friends if you really need to optimize your code. and (as in python, and as several others have pointed out), if you have something especially challenging, write it in C/C++/fortran instead, and link it to R.