Preface

This is a book aimed at summarizing my knowledge in python language

Setup

I mainly work with RStudio, therefore I won’t go deeper inside the usual Pyhton Setup, instead I just suggest to install the package reticulate and work with it within RStudio.

#install.packages('reticulate')
library(reticulate)
# conda_list()
# conda_version()
virtualenv_create(envname = "r-reticulate",
    packages = c('pandas', 'numpy', 'scikit-learn')
)
virtualenv_list()
virtualenv_exists()
virtualenv_root()
#-------------------------------------
use_virtualenv(virtualenv_root()
) 
#repl_python()
#quit

Now Python is ready to use

Here you can find everything you need to know on using reticulate package in r


To clear all the environment

# import sys
# sys.modules[__name__].__dict__.clear()

#Or delete single object
#del <variable_name>