Power up your data science workflow with ChatGPT
Project description
pandas-gpt
Power up your data science workflow with ChatGPT.
pandas-gpt
is a Python library for doing almost anything with a pandas DataFrame based on natural language queries.
Installation
pip install pandas-gpt
Set the OPENAI_API_KEY
environment variable to your OpenAI API key, or use the following code snippet:
import openai
openai.api_key = '<API Key>'
If you are using another host like Azure:
import openai
openai.api_type = 'azure'
openai.api_base = '<Endpoint>'
openai.api_version = '<Version>'
openai.api_key = '<API Key>'
import pandas_gpt
# pandas_gpt.model = '<Model>' # Default is 'gpt-3.5-turbo'
pandas_gpt.completion_config = {
'engine': '<Engine>',
# 'deployment_id': '<Deployment ID>',
}
Examples
Setup and usage examples are available in this Google Colab notebook.
import pandas as pd
import pandas_gpt
df = pd.DataFrame(...)
# Run Python code generated by ChatGPT
df.ask('plot x and y with nice colors')
# Return a value
model = df.ask('LightGBM model trained on the dataset')
# Specify a column or index
df['my_column'].ask('geometric mean')
# Show additional output
df.ask('clean the dataset', verbose=True)
# Print source code without running
df.ask.code('do something interesting with the dataset')
Alternatives
- GitHub Copilot: General-purpose code completion (paid subscription)
- Sketch: AI-powered data summarization and code suggestions (works without an API key)
Disclaimer
Please note that the limitations of ChatGPT also apply to this library. I would recommend using pandas-gpt
in a sandboxed environment such as Google Colab, Kaggle, or GitPod.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pandas-gpt-0.5.0.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for pandas_gpt-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f375f3a22de15700b0d4651e40da579b3497dea5777636388fb6c82b137666f |
|
MD5 | bdab4f1eefa54b1e4e7c1abddd453c9e |
|
BLAKE2b-256 | b8531ed075ba7b9e88891733397a570c615e4a954dd25bbfdad006a0425734f5 |