I'm having problems getting gpt-3 to do simple statistical summaries of a dataframe/json file - using python pandas as the suggested prompt, oddly it does categorical analysis of the df, ie value_counts etc but seems to hallucinate when faced with numbers but i'm sure its just my error. I'm not sure if its the way i'm feeding the df in or something else? cheers.
import pandas as pd
import openai
from sqlalchemy import create_engine
openai.api_key = "API_KEY"
query = "Select * from table"
engine = create_engine()
df = pd.read_sql_query(query, engine)
completion = openai.Completion.create(
engine="text-davinci-003",
temperature=0.5,
max_tokens=100,
n = 1,
stop=None,
prompt = (f"print sum of values in df called {df}" ) ) `
a = completion.choices[0].text
print(a)
i tried to use different versions of the file and different ways of calling but to no effect, changed engines also