Skip to content

This repository showcases the application of artificial intelligence directly to the traditional Pandas library. pandasAI enables data analysis with Python by utilizing text-based, human-like conversations. This is made possible using GenAI, allowing users to perform data analysis tasks with simple text prompts, eliminating the need for traditional

inuwamobarak/pandasAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

pandasAI

GitHub repo size GitHub stars GitHub forks GitHub

This repository showcases the application of artificial intelligence directly to the traditional Pandas library. pandasAI enables data analysis with Python by utilizing text-based, human-like conversations. This is made possible using GenAI, allowing users to perform data analysis tasks with simple text prompts, eliminating the need for traditional code-based workflows.

Table of Contents

Introduction

PandasAI revolutionizes the way data analysis is performed using the Pandas library. By leveraging artificial intelligence and natural language processing techniques, pandasAI enables users to interact with data through text-based conversations. This simplifies the data analysis process and makes it more accessible to a wider audience, eliminating the need for writing complex code.

Installation

To use the PandasAI library, follow these steps:

  1. Install pandasAI using pip: pip install pandasAI
  2. Import the library in your Python script: import pandasAI as pdai
  3. Ensure you have the required dependencies installed, such as Pandas and GenAI.

Usage

  1. Import the PandasAI library: import pandasAI as pdai
  2. Load your dataset using Pandas: df = pdai.read_csv('dataset.csv')
  3. Perform data analysis tasks by interacting with the data using text prompts and commands.
  4. Utilize available functions and methods provided by PandasAI for data manipulation, exploration, visualization, and more.

Getting Started with Pandas AI

This guide will walk you through the process of getting started with PandasAI. There are two approaches you can take to use PandasAI: using LangChain models and direct implementation.

Using LangChain Models

To use LangChain models, you first need to install the Langchain package:

pip install langchain

Once installed, you can instantiate a LangChain object in your code:

from pandasai import PandasAI
from langchain.llms import OpenAI

langchain_llm = OpenAI(openai_api_key="my-openai-api-key")
pandasai = PandasAI(llm=langchain_llm)

With these steps, your environment is now ready, and PandasAI will automatically utilize the LangChain llm and convert it to a PandasAI llm.

Direct Implementation (Without LangChain)

If you prefer a direct implementation without using LangChain, follow these steps:

  1. Start by installing PandasAI as it may not be preinstalled like Pandas:
pip install pandasai
  1. Another crucial requirement is an OpenAI API key to use PandasAI. You can create an API key with an account on the OpenAI platform. Visit OpenAI Account API Keys to create a key.

Make sure to keep your API key secure and follow best practices for handling API keys.

Once you have completed these steps, you can start using PandasAI for your data analysis tasks.

Example Output

The following examples demonstrate how pandasAI simplifies data analysis tasks:

download (14)

download (12)

Contributing

Contributions to pandasAI are welcome. To contribute, follow these steps:

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature/your-feature
  3. Make your changes and commit them: git commit -m 'Add some feature'
  4. Push to the branch: git push origin feature/your-feature
  5. Submit a pull request.

License

This project is licensed under the MIT License.

GitHub Repository

The official GitHub repository for pandasAI can be found at: https://github.com/gventuri/pandas-ai

About

This repository showcases the application of artificial intelligence directly to the traditional Pandas library. pandasAI enables data analysis with Python by utilizing text-based, human-like conversations. This is made possible using GenAI, allowing users to perform data analysis tasks with simple text prompts, eliminating the need for traditional

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published