Giter Site home page Giter Site logo

inuwamobarak / pandasai Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 599 KB

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

Home Page: https://www.analyticsvidhya.com/blog/2023/07/pandasai-a-genai-powered-data-analysis-library/

Jupyter Notebook 100.00%
data-analysis genai stable-diffusion pandasai huggingface huggingface-transformers python

pandasai's Introduction

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

pandasai's People

Contributors

inuwamobarak avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.