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 - Simple Example Project
A simple example project demonstrating how to use PandasAI with your own datasets.
## Setup
1. **Activate your virtual environment:**
```powershell
.\projectenv\Scripts\activate
```
2. **Set up environment variables in `.env`:**
```
OPENAI_API_KEY=your-api-key
OPENAI_API_BASE=https://openrouter.ai/api/v1
```
## Quick Start
```python
import os
import pandas as pd
import pandasai as pai
from extensions.llms.openai.pandasai_openai.openai import OpenAI
# Set up the LLM
llm = OpenAI(
api_key=os.environ["OPENAI_API_KEY"],
api_base=os.environ["OPENAI_API_BASE"]
)
pai.config.set({"llm": llm})
# Load your data
df = pd.read_csv("data.csv")
smart_df = pai.DataFrame(df)
# Ask questions
answer = smart_df.chat("What is the average value?")
print("Answer:", answer)
```
## Run the Demo
```powershell
python demo.py
```
## License
MIT License
# dataai