Working with packages
How to work with packages
DataCamp Workspace is preconfigured a recent version of Python and R and a host of ocmmonly used data science and machine learning packages.
When in the Workspace editor, click on the Environment tab
in the sidebar on the left. You can now browse and search an overview of all available packages. If you search for a package that is not pre-installed, you will get instructions on how to install that particular package. If you click "Add to notebook", the package install command will be added at the top of your notebook in a new code cell and immediately executed.
Package install instructions that appear if you want to install an R package that is not yet available.
If a package you want to use is not pre-installed, you can install it yourself using as described below.
To install additional packages, add
!pip install <name-of-pkg>e.g.
!pip install pythonwhatin a code cell. If you want to suppress the output when installing additional packages, you can use
%%capturein the line above the
!pip install PyPortfolioOpt
If you want to suppress the output when installing additional packages, you can use the
quiet = TRUEargument:
install.packages("PortfolioAnalytics", quiet = TRUE)
You can also use
suppressPackageStartupMessages()to suppress output.