I have integrated python and tableau
import pandas as pd
from pandasql import sqldf
import pandasql as psql
cars = {'Brand': ['Honda Civic','Toyota Corolla','Ford Focus','Audi A4'],
'Price': [22000,25000,27000,35000]}
df = pd.DataFrame(cars)
def test_query(df):
df = pd.DataFrame(df)
q = """select * from df"""
df2 = psql.sqldf(q, locals())
return df2
test_query(df)
I have run the following code and I got an error
Unable to retrieve results for field [{0}]
How can I resolve it?