You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PandasAI is a Python platform that makes it easy to ask questions to your data in natural language. It helps non-technical users to interact with their data in a more natural way, and it helps technical users to save time, and effort when working with data.
π§ Getting started
You can find the full documentation for PandasAI here.
You can either decide to use PandasAI in your Jupyter notebooks, Streamlit apps, or use the client and server architecture from the repo.
π Using the library
Python Requirements
Python version 3.8+ <3.12
π¦ Installation
You can install the PandasAI library using pip or poetry.
With pip:
pip install "pandasai>=3.0.0b2"
With poetry:
poetry add "pandasai>=3.0.0b2"
π» Usage
Ask questions
importpandasaiaspaifrompandasai_openai.openaiimportOpenAIllm=OpenAI("OPEN_AI_API_KEY")
pai.config.set({
"llm": llm
})
# Sample DataFramedf=pai.DataFrame({
"country": ["United States", "United Kingdom", "France", "Germany", "Italy", "Spain", "Canada", "Australia", "Japan", "China"],
"revenue": [5000, 3200, 2900, 4100, 2300, 2100, 2500, 2600, 4500, 7000]
})
df.chat('Which are the top 5 countries by sales?')
China, United States, Japan, Germany, Australia
Or you can ask more complex questions:
df.chat(
"What is the total sales for the top 3 countries by sales?"
)
The total sales for the top 3 countries by sales is 16500.
Visualize charts
You can also ask PandasAI to generate charts for you:
df.chat(
"Plot the histogram of countries showing for each one the gd. Use different colors for each bar",
)
Multiple DataFrames
You can also pass in multiple dataframes to PandasAI and ask questions relating them.
You can find more examples in the examples directory.
π License
PandasAI is available under the MIT expat license, except for the pandasai/ee directory of this repository, which has its license here.
If you are interested in managed PandasAI Cloud or self-hosted Enterprise Offering, contact us.
Resources
Beta Notice
Release v3 is currently in beta. The following documentation and examples reflect the features and functionality in progress and may change before the final release.
Discord for discussion with the community and PandasAI team
π€ Contributing
Contributions are welcome! Please check the outstanding issues and feel free to open a pull request.
For more information, please check out the contributing guidelines.
Thank you!
About
Chat with your database or your datalake (SQL, CSV, parquet). PandasAI makes data analysis conversational using LLMs and RAG.