Using PandasAI for imputation
Many of the missing value imputation tasks we have explored in this chapter can also be completed using PandasAI. As we have discussed in previous chapters, AI tools can help us check the work we have done with traditional tools and can suggest alternative approaches that did not occur to us. It always makes sense, though, to look under the hood and be sure we understand what PandasAI, or other AI tools, are doing.
We will use PandasAI in this recipe to identify missing values, impute missing values based on summary statistics, and assign missing values based on machine learning algorithms.
Getting ready
We will work with PandasAI in this recipe. It can be installed with pip install
pandasai
. You also need to get a token from openai.com to send a request to the OpenAI API.
How to do it...
In this recipe, we will carry out many of the tasks we have done earlier in this chapter using AI tools instead.
- We start by importing...