Diagnosing missing values in R and Python
Before thinking about imputing missing values in a dataset, we must first know the extent to which the missing values affect each individual variable.
You can find the code used in this section in the Chapter12\R\03-diagnose-missing-values-in-r.R and Chapter12\Python\03-diagnose-missing-values-in-python.py files. In order to properly run the code and the code of the following sections, you need to install the requisite R and Python packages as follows:
- Open the Anaconda prompt.
- Enter the
conda activate pbi_powerquery_envcommand. - Enter the
pip install missingnocommand. - Enter the
pip install upsetplotcommand. - Then, open RStudio and make sure it is referencing your latest CRAN R (version 4.0.2 in our case).
- Click on the Console window and enter
install.packages('naniar'). Then press Enter. - Enter
install.packages('imputeTS'). Then press Enter. - Enter
install.packages('forecast&apos...