PandasAI is an open-source Python library that enables conversational data analysis by letting users query and interact with tabular data (pandas DataFrames, CSV, parquet, SQL) using natural language. It integrates with large language models (LLMs) to generate analysis, visualizations, and code, supports multiple DataFrames and a Docker sandbox for safe execution, and is distributed under the MIT license.
PandasAI is a Python library that brings conversational capabilities to tabular data analysis. By connecting pandas DataFrames to a large language model (LLM), PandasAI allows users to ask natural-language questions about their data, get analysis summaries, request plots, and produce pandas code snippets or direct answers — all through a chat-like interface.
Example:
import pandasai as pai
from pandasai_litellm.litellm import LiteLLM
llm = LiteLLM(model="gpt-4.1-mini", api_key="YOUR_OPENAI_API_KEY")
pai.config.set({"llm": llm})
df = pai.read_csv("data/companies.csv")
response = df.chat("What is the average revenue by region?")
print(response)PandasAI is published under the MIT license. The repository provides documentation, examples, and a Discord community for discussion.
The project provides docs at the official site and examples in the GitHub repository. It includes CI/CD badges, tests coverage, and installation instructions in its README.