1

I want to insert a record with psycopg2. The code is simple:

import psycopg2
query = """
    INSERT INTO xxx (lon,lat)
    VALUES(%s,%s)"""
cursor.execute(query, (df2['lon'],df2['lat']))
 conn.commit()
cursor.close()
conn.close()

However the code does not work and raised the below error:

psycopg2.ProgrammingError: can't adapt type 'Series'

How do I solve the issue?

Paolo
  • 20,112
  • 21
  • 72
  • 113
bibiji
  • 147
  • 1
  • 9

0 Answers0