from praisonaiagents import Agent
from praisonaiagents import read_csv, get_summary
agent = Agent(
name="Data Analyst",
instructions="Analyse tabular data with pandas tools.",
tools=[read_csv, get_summary],
)
agent.start("Describe the sales.csv dataset and highlight outliers")
The user names a dataset; the agent loads it with pandas tools and explains key statistics.
Diagram
graph LR
U[Input] --> A[Agent]
A --> T[Tool]
T --> O[Output]
classDef agent fill:#8B0000,color:#fff
classDef tool fill:#189AB4,color:#fff
class A agent
class U,O tool
class T tool
Diagram
sequenceDiagram
participant User
participant Agent
participant Feature as Pandas Agent
User->>Agent: Request
Agent->>Feature: Process request
Feature-->>Agent: Result
Agent-->>User: Response
Pandas Tools
Use Pandas Tools to manipulate and analyze data with AI agents.
from praisonaiagents import Agent, Task, AgentTeam
from praisonai_tools import read_csv, read_excel, write_csv, write_excel, filter_data, get_summary, group_by, pivot_table
Create Agent
Create a data analysis agent:
python
data_agent = Agent(
name="DataAnalyst",
role="Data Analysis Specialist",
goal="Analyze and transform data efficiently.",
backstory="Expert in data manipulation and statistical analysis.",
tools=[read_csv, read_excel, write_csv, write_excel, filter_data, get_summary, group_by, pivot_table],
reflection=False
)
Define Task
Define the analysis task:
python
analysis_task = Task(
description="Analyze sales data to identify trends and patterns.",
expected_output="Statistical summary and key insights.",
agent=data_agent,
name="sales_analysis"
)
from praisonai_tools import read_csv
from praisonai_tools import read_excel
from praisonai_tools import write_csv
from praisonai_tools import write_excel
from praisonai_tools import filter_data
from praisonai_tools import get_summary
from praisonai_tools import group_by
from praisonai_tools import pivot_table
Examples
Basic Data Analysis Agent
python
from praisonaiagents import Agent, Task, AgentTeam
from praisonai_tools import read_csv, filter_data, get_summary, group_by
# Create data analysis agent
data_agent = Agent(
name="DataExpert",
role="Data Analyst",
goal="Process and analyze data efficiently.",
backstory="Expert in data analysis and statistical methods.",
tools=[read_csv, filter_data, get_summary, group_by],
reflection=False
)
# Define analysis task
analysis_task = Task(
description="Analyze sales performance data.",
expected_output="Sales analysis report.",
agent=data_agent,
name="sales_analysis"
)
# Run agent
agents = AgentTeam(
agents=[data_agent],
tasks=[analysis_task],
process="sequential"
)
agents.start()