Calling Python from R is easy and is useful to access Python libraries. In this RStats tutorial, we show you how to set up a Python session within R and some tips for translating your code. We will also run similar algorithms in Python and R to see how they compare for speed! Subscribe to learn more about R and how you can make your code faster. 🐍
00:00 Introduction and dataset
01:45 1st approach: Growing a vector with for loops
02:55 Translating R code to Python code
07:48 1st approach: Benchmarking
08:47 2nd approach: Dataframe pre-allocation
10:41 3rd approach: Lists - vectorization
13:17 4th approach: Linear algebra - matrices: Numpy
14:52 5th approach: Dataframe manipulation: Pandas
16:36 Fastest algorithms comparison
🦕 Get the code here: https://github.com/MaximeRivest/dds/b...
🏎️ R performance playlist • R Programming - Performance
🧮 dplyr playlist • dplyr
#R #Rprogramming #Python #Rtutorial #RStats #performance #RStudio #datascience #DDS #DDSR #datatable #dplyr