NOTE: All instructions in capital letters indicate code that you should fill in with the appropriate information.
reticulate package (do not include this code).reticulate library.library(reticulate)
py_config()
## python: C:\Users\User\AppData\Local\Programs\Python\Python37\python.exe
## libpython: C:/Users/User/AppData/Local/Programs/Python/Python37/python37.dll
## pythonhome: C:\Users\User\AppData\Local\Programs\Python\Python37
## version: 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
## Architecture: 64bit
## numpy: C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy
## numpy_version: 1.17.1
##
## python versions found:
## C:\Users\User\AppData\Local\Programs\Python\Python37\python.exe
## C:\Users\User\AppData\Local\Programs\Python\Python37\\python.exe
py_config() to find the python versions you have installed on your machine.python: /usr/bin/python
libpython: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib
pythonhome: /System/Library/Frameworks/Python.framework/Versions/2.7:/System/Library/Frameworks/Python.framework/Versions/2.7
version: 2.7.16 (default, Oct 17 2019, 17:14:30) [GCC 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.32.4) (-macos10.15-objc-s
numpy: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy
numpy_version: 1.8.0
python versions found:
/usr/bin/python
/usr/bin/python3
/usr/local/bin/python3
/Users/buchanan/anaconda3/bin/python
python on the top line is the one you want to use, you are all done./Users/buchanan/...) and tell R to talk to that python instead.use_python("PATH", required = TRUE).use_python() after running py_config(). You will get an error message:ERROR: The requested version of Python
('/Users/buchanan/anaconda3/bin/python') cannot be used, as
another version of Python ('/usr/bin/python') has already
been initialized. Please restart the R session if you need
to attach reticulate to a different version of Python.
Error in use_python("/Users/buchanan/anaconda3/bin/python", required = TRUE) :
failed to initialize requested version of Python
use_python() code.py_config() and use_python() in the same markdown. Once you know where your path is, just use use_python().data(rock) to load it.head() function to print out the first six rows of the dataset.numpy, nltk, spacy, seaborn and pandas for starters.You can check if you have them first by using py_module_available("PACKAGE").
If any of these return FALSE, then install them using py_install("PACKAGE").
#if they are all TRUE, leave this blank
seaborn library, it has several sample datasets. You load python packages by using import PACKAGE.dots dataset by doing: VARNAME = PACKAGENAME.load_dataset("DATASETNAME")..head() function: VARNAME.head().QUESTION: Look in your environment window. What do you see?
py$VARNAME.DATAFRAME$COLUMN. Try to print out the time column from your dots variable (whatever you named it above).$, we use . like this: r.VARNAME.DATAFRAME["COLUMNNAME"]. Try printing out the shape column in the rock dataset.