Not able to insert null values into teradata table using python.
I have excel file of 5000 records.One column has all null values.I want to insert to teradata table as-is using python script.But after insertion in place of Null its inserted NaN values.
import pandas as pd
import teradata
dataset=pd.read_excel("Filepath",skiprows=[0])
host,username,password = 'hostname','username', 'password'
#Make a connection
udaExec = teradata.UdaExec (appName="test", version="1.0", logConsole=False)
session = udaExec.connect(driver='Teradata',method="odbc", system=host,username=username, password=password);
for row in range(0,dataset.shape[0]):
col=list(df.values[row])
session.execute("""INSERT INTO PRSNA_STG(PRSNA_ID,BIRTH_DT,DEATH_DT,GNDR_TYPE_CD,ETHCTY_TYPE_CD,NTLTY_CD,MARITAL_CD)VALUES(?,CAST(? AS DATE FORMAT 'MM/DD/YYYY'),?,?,?,?,?)""",(col[0],'/'.join([str(i).zfill(2) for i in col[1].split('/')]),col[2],col[3],col[4],col[5],col[6]))
col[2] is the one which am speaking about.The above code is working.But DEATH_DT values in teradata are showing as NaN