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