Hello,
I am trying to retrieve data from a database table using sqlalchemy
Set
sec sectors
;
$onEmbeddedCode Python:
import sqlalchemy
import pandas as pd
from sqlalchemy import create_engine
engine = create_engine('mssql://LAPTOP-HdfDNQL8E4/POLIFOLIO_DB?driver=SQL+Server+Native+Client+11.0?trusted_connection=yes')
sec = pd.read_sql_query('select distinct cast(SECTORID AS INT) from pf_actions', engine)
df = pd.DataFrame(sec)
gams.set('sec', [tuple(x) for x in df.values.tolist()])
$offEmbeddedCode sec
sectorid is a column with decimals.
Unfortunately it returns an error
Cannot load/unload symbol with unknown dimension:
How can i load my data to “sec” set?