pandas-ai icon indicating copy to clipboard operation
pandas-ai copied to clipboard

Add Excel Functionality

Open HisokaMagician101 opened this issue 2 years ago • 2 comments

🚀 The feature

Be able to read in an excel dataframe

Motivation, pitch

I'm not a great programmer, want the ability to read in data from excel

Alternatives

N/A

Additional context

N/A

HisokaMagician101 avatar May 13 '23 16:05 HisokaMagician101

I can take this one @gventuri

aryandgandhi avatar May 13 '23 16:05 aryandgandhi

Assigned to you @aryandgandhi 🚀

gventuri avatar May 14 '23 14:05 gventuri

@aryandgandhi Are you working on this? I'd like to submit a PR.

jonbiemond avatar May 20 '23 17:05 jonbiemond

Yeah I was waiting for google sheets to be approved. Feel free to submit one though

aryandgandhi avatar May 20 '23 17:05 aryandgandhi

Hi @HisokaMagician101, I believe this does not require any extra feature. One can simply use pandas

import pandas as pd
from pandasai import PandasAI
from pandasai.llm import OpenAI

excel_file = '/path/to/you/excel/file'
df = pd.read_excel(excel_file)

llm = OpenAI()
pandas_ai = PandasAI(llm, verbose=True)
response = pandas_ai(df, "your-prompt-here")
print(response)

mspronesti avatar May 21 '23 17:05 mspronesti