datasloth
datasloth copied to clipboard
Not able to transpose table
Great work. But when I tried to "transpose table" it did not get it. Then I tried...
sloth.query("columns in rows and rows in columns", show_query=True)
SELECT *
FROM (
SELECT *
FROM T
LIMIT 10
)
PIVOT (
COUNT(*)
FOR column_name
IN ('a', 'b', 'c')
)
Unsuccessful. Try rephrasing your query, or add additional table descriptions in df.sloth.description. You can inspect the generated prompt and GPT response in sloth.show_last_prompt().
sloth.show_last_prompt is not working by the way.
After upgrading the package to use model "text-davinci-003" (instead of version 002) I get this query:
SELECT *
FROM df
PIVOT (
COUNT(*)
FOR b IN ('e', 'h')
)
But that is not working as well.
Thanks for the info :) Seems like this might be a bit out of scope for Datasloth. In general, it is aimed more at answering "real" questions, instead of doing data transformations. But I will keep this in mind when making improvements.
Re. show_last_prompt
, I will fix that, thanks!