登录 注册
数据分析与数据处理AI 模型与开发框架内容创作与媒体工具 aicsvdatadata-analysisdata-sciencedata-visualization
23,949
Stars
2,347
Forks
164
Watchers
24
Open Issues
NOASSERTION
许可证
Python
语言
2023-04-22
创建时间
2025-10-28
最近更新

项目能做什么

结合 LLM 与 RAG,支持与 SQL、CSV、parquet 等数据库或数据湖对话分析。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# ![PandasAI](assets/logo.png)

[![Release](https://img.shields.io/pypi/v/pandasai?label=Release&style=flat-square)](https://pypi.org/project/pandasai/)
[![CI](https://github.com/sinaptik-ai/pandas-ai/actions/workflows/ci-core.yml/badge.svg)](https://github.com/sinaptik-ai/pandas-ai/actions/workflows/ci-core.yml/badge.svg)
[![CD](https://github.com/sinaptik-ai/pandas-ai/actions/workflows/cd.yml/badge.svg)](https://github.com/sinaptik-ai/pandas-ai/actions/workflows/cd.yml/badge.svg)
[![Coverage](https://codecov.io/gh/sinaptik-ai/pandas-ai/branch/main/graph/badge.svg)](https://codecov.io/gh/sinaptik-ai/pandas-ai)
[![Discord](https://dcbadge.vercel.app/api/server/kF7FqH2FwS?style=flat&compact=true)](https://discord.gg/KYKj9F2FRH)
[![Downloads](https://static.pepy.tech/badge/pandasai)](https://pepy.tech/project/pandasai) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1ZnO-njhL7TBOYPZaqvMvGtsjckZKrv2E?usp=sharing)

PandasAI is a Python library 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](https://docs.pandas-ai.com/).


## 📚 Using the library

### Python Requirements

Python version `3.8+ <=3.11`

### 📦 Installation

You can install the PandasAI library using pip or poetry.

With pip:

```bash
pip install pandasai
pip install pandasai-litellm
```

With poetry:

```bash
poetry add pandasai
poetry add pandasai-litellm
```

### 💻 Usage

#### Ask questions

```python
import pandasai as pai
from pandasai_litellm.litellm import LiteLLM

# Initialize LiteLLM with your OpenAI model
llm = LiteLLM(model="gpt-4.1-mini", api_key="YOUR_OPENAI_API_KEY")

# Configure PandasAI to use this LLM
pai.config.set({
    "llm": llm
})

# Load your data
df = pai.read_csv("data/companies.csv")

response = df.chat("What is the average revenue by region?")
print(response)
```

---

Or you can ask more complex questions:

```python
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:

```python
df.chat(
    "Plot the histogram of countries showing for each one the gdp. Use different colors for each bar",
)
```

![Chart](assets/histogram-chart.png?raw=true)

#### Multiple DataFrames

You can also pass in multiple dataframes to PandasAI and ask questions relating them.

```python
import pandasai as pai
from pandasai_litellm.litellm import LiteLLM

# Initialize LiteLLM with your OpenAI model
llm = LiteLLM(model="gpt-4.1-mini", api_key="YOUR_OPENAI_API_KEY")

# Configure PandasAI to us
阅读完整原文

商业机会分析 AI 生成

垂直行业轻量级AI BI看板(Web/SaaS)

产品构想基于PandasAI封装开箱即用的Web前端,提供文件上传、自然语言多表联合提问、图表自动渲染与导出功能,主打免部署的团队级轻量分析工作台。
核心功能拖拽式CSV/Excel/SQL上传、自然语言对话生成交互式图表、历史分析记录保存、报告一键导出PDF/PPT
目标用户电商卖家、小微出海企业运营、财务与市场分析人员(尚需验证的假设)
难度/周期中等 · 4-6周 · 成本:前端UI开发、云服务器及Docker环境部署成本、第三方LLM API Token费用
收费模式按月订阅制(SaaS),分设个人基础版与团队协作版;或按查询次数计费
竞争风险通用对话产品竞争激烈,直接面临ChatGPT Plus Code Interpreter与主流BI工具自带AI功能的挤压
依据 已验证事实

企业私有化安全数据分析网关(中间件)

产品构想针对企业数据合规痛点,结合PandasAI与DockerSandbox机制,打包为可在企业内网一键部署的安全容器中间件,对接本地大模型(如Ollama/vLLM)并提供安全审计。
核心功能本地大模型接口适配、代码执行完全隔离沙箱(Docker/Firecracker)、数据脱敏传输层、SQL/Python代码审计日志
目标用户中大型企业IT架构师、对合规和数据出境有严格要求的金融/医疗/政务软件集成商(AI推测)
难度/周期较高 · 6-10周 · 成本:私有化部署测试环境、安全合规漏洞扫描工具费用
收费模式软件买断授权费(按节点/CPU核数)+ 年度技术支持维保服务费
竞争风险开源仓库本身包含商业化ee目录(官方已有Enterprise Offering布局),可能存在专利或客户直接采购官方企业版的竞争风险
依据 已验证事实

无代码/低代码平台的数据分析Copilot插件

产品构想将PandasAI能力封装为专有插件/扩展组件,嵌入主流开源平台(如Metabase、Superset、Appsmith、Notion等),为现有低代码/BI系统赋能。
核心功能自然语言转SQL/Pandas操作、即插即用API、自定义Schema导入与Prompt微调模版管理
目标用户使用开源BI或内部管理后台的开发者、企业信息化实施团队(尚需验证的假设)
难度/周期较低 · 3-5周 · 成本:插件商店入驻成本、轻量测试云主机
收费模式应用市场单次付费购买、API代理调用差价抽成、企业集成定制服务费
竞争风险对宿主系统的API变动高度依赖,维护成本受制于第三方平台更新
依据 数据支持的判断
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
morluto/rea 中文介绍暂未生成
Reverse engineer anything with agents, from app behavior dow
452,288 TypeScript
openclaw/openclaw 中文介绍暂未生成
The AI that really does things. Any OS. Any Platform. The lo
394,353 TypeScript
obra/superpowers 中文介绍暂未生成
An agentic skills framework & software development methodolo
316,183 Shell
NousResearch/hermes-agent 中文介绍暂未生成
The agent that grows with you
262,686 Python
n8n-io/n8n 中文介绍暂未生成
Fair-code workflow automation platform with native AI capabi
210,179 TypeScript
firecrawl/firecrawl 中文介绍暂未生成
Supercharge your AI agents with data from the web and beyond
200,882 TypeScript
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 2023-04-22,最近推送 2025-10-28,发布过 100 个 Release
社区活跃Star 23,949 / Fork 2,347 / Issue 24(数据支持,可自行核实)
许可证NOASSERTION
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

快速开始(以仓库 README 为准)
git clone https://github.com/sinaptik-ai/pandas-ai.git
cd pandas-ai
# 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
阅读原仓库文档
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。