Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "map" function to the API #1093

Open
DmitriiCM opened this issue Apr 7, 2024 · 0 comments
Open

Add "map" function to the API #1093

DmitriiCM opened this issue Apr 7, 2024 · 0 comments

Comments

@DmitriiCM
Copy link

馃殌 The feature

It would be nice to add a map-style feature to PandasAI. Sometimes it's important to process a specific column using LLM. I already did a proof of concept, and it works well.

Motivation, pitch

The idea is to do something like this:

sales_by_country = pd.DataFrame({
    "country": ["United States", "United Kingdom", "France", "Germany", "Italy", "Spain", "Canada", "Australia", "Japan", "China"],
    "sales": [5000, 3200, 2900, 4100, 2300, 2100, 2500, 2600, 4500, 7000]
})

agent = Agent(sales_by_country)
sales_by_country["population"] = agent.map("Write an approximate population of the country", from_column="country")

Alternatives

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant