Home Machine Learning Exploring the Energy of Pure Language Information Manipulation with PandasAI | by Mia Dwyer | Apr, 2024

Exploring the Energy of Pure Language Information Manipulation with PandasAI | by Mia Dwyer | Apr, 2024

0
Exploring the Energy of Pure Language Information Manipulation with PandasAI | by Mia Dwyer | Apr, 2024

[ad_1]

How generative AI supercharges Pandas capabilities

I not too long ago 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 instantly in pure language whereas in a Jupyter pocket book.

Enter PandasAI 🐼✨ a free, open supply Python library.*

Picture created by me, utilizing DALL-E

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:

Picture created by the writer, in Jupyter Lab, utilizing pandasai to “discuss” to a transactions dataset.

This half does require signing up for an OpenAI developer account, however concern not! OpenAI makes this step fairly straightforward, it primarily simply requires producing a token that you will want to incorporate in your pocket book.

You’ll have to navigate to the “API Keys” web page → https://platform.openai.com/api-keys

Screenshot of https://platform.openai.com/ by the writer.
Screenshot of https://platform.openai.com/api-keys by the writer.

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 — try my different article!

import pandas as pd
from pandasai import SmartDataframe

dataframe = pd.read_csv('transactions.csv')

# hook up with OpenAI dev with the API token we simply created :) 
from pandasai.llm.openai…

[ad_2]