I already referred this post, this post, this post. So, please don't mark as duplicate
I have a raw data in pandas dataframe which is called temp_id as shown below.
The column is of datatype float64 because of NA's and it looks like as shown below in jupyter notebook
temp_id
55608.0
55609.0
NaN
55610.0
NaN
55611.0
In csv file, the same column looks like as shown below
temp_id
55608
55609
#empty row indicating NA
55610
#empty row indicating NA
55611
Am trying to copy this data into a postgresql table with below table definition. Please note that it is not primary key and can have empty rows
CREATE TABLE temp(
temp_id integer
);
When I try to copy the data, I get the below error
ERROR: invalid input syntax for integer: "55608.0"
CONTEXT: COPY temp, line 2, column temp_id: "55608.0"
How can I avoid this and insert this data into a integer column in Postgresql table? The below are the miscellaneous characters that I give in pgadmin during import csv

.astype(int)before inserting? The error seems to indicate there's an issue with the decimal point in the floatspandas, it throws error because the column hasnavalues. So cannot convert toint.astype.ValueError: Cannot convert non-finite values (NA or inf) to integerNaNis a value in float, but int values do not haveNaN. Said another way: Trying to build a column with1, 2, 3.1, the computer will assume the entire column is a float. SinceNaNony exists in floats, then the whole column becomes one.