I lately found a really intriguing new instrument that marries my curiosity in information science and generative AI, which lets you leverage ChatGPT to “discuss” to your information immediately in pure language whereas in a Jupyter pocket book.
Enter PandasAI 🐼✨ a free, open supply Python library.*
Datacamp describes PandasAI as “a Python library that makes use of genAI fashions to supercharge pandas capabilities. It was created to enhance the pandas library, a widely-used instrument for information evaluation and manipulation.” [1]
Beneath is an instance of how one can leverage the spectacular capabilities of PandasAI, even with restricted data of Python and Pandas:
This half does require signing up for an OpenAI developer account, however worry not! OpenAI makes this step fairly simple, it primarily simply requires producing a token that you’ll want to incorporate in your pocket book.
You’ll must navigate to the “API Keys” web page → https://platform.openai.com/api-keys
First we have to import the related packages and no matter dataset we’re eager to “converse” with. For this instance, I’m utilizing a designer dummy dataset that I simply created with Generative AI — to learn to do this — check out my other article!
import pandas as pd
from pandasai import SmartDataframedataframe = pd.read_csv('transactions.csv')
# hook up with OpenAI dev with the API token we simply created :)
from pandasai.llm.openai…
