I am trying to insert a dataframe into a sql table and I get the following error
ProgrammingError: (pyodbc.ProgrammingError) ('Unknown object type numpy.ndarray during describe', 'HY000')
for the following code
merged.to_sql('pmg.cwc.EmSignals1', engine, chunksize=1000,
if_exists='replace',
index=False,
dtype ={'monthenddate': sqlalchemy.types.NVARCHAR(length=20),
'lastweekday': sqlalchemy.types.NVARCHAR(length=20),
'item': sqlalchemy.types.NVARCHAR(length=20),
'sols': sqlalchemy.types.NVARCHAR(length=20),
'value': sqlalchemy.types.NVARCHAR(length=20)})
This is a .head of the dataframe
monthenddate lastweekday item sols value
0 1999-12-31 1999-12-31 value 2W063W1 -0.870225
1 1999-12-31 1999-12-31 value W1YBRK4 0.078154
2 1999-12-31 1999-12-31 value X16W902 -0.072731
3 1999-12-31 1999-12-31 value 2X45X4W 1.278582
4 1999-12-31 1999-12-31 value 23X1XWX 0.293649
I have tried a lot, but cannot figure out the cause of the issue.