class_docstr: This handler handles connection and execution of the PostgreSQL with pgvector extension statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","PostgreSQL","with","pgvector","extension","statements","."]
docstr: Insert data into the pgvector table database.
docstr_tok: ["Insert","data","into","the","pgvector","table","database","."]
code: def insert(self, table_name: str, data: pd.DataFrame):
      """
      Insert data into the pgvector table database.
      """
      data_dict = data.to_dict(orient="list")
      transposed_data = list(zip(*data_dict.values()))
  
      columns = ", ".join(data.keys())
      values = ", ".join(["%s"] * len(data.keys()))
  
      insert_statement = (
          f"INSERT INTO {table_name} ({columns}) VALUES ({values})"
      )
  
      with self.connection.cursor() as cur:
          cur.executemany(insert_statement, transposed_data)
          self.connection.commit()
  
imports: from collections import OrderedDict
  from typing import List, Union
  import pandas
  import psycopg
  from mindsdb_sql import ASTNode, Parameter, Identifier, Update, BinaryOperation
  from pgvector.psycopg import register_vector
  from mindsdb.integrations.handlers.postgres_handler.postgres_handler import PostgresHandler
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
  from mindsdb.integrations.libs.response import RESPONSE_TYPE
  from mindsdb.integrations.libs.response import HandlerResponse
  from mindsdb.integrations.libs.vectordatabase_handler import FilterCondition, VectorStoreHandler
  from mindsdb.utilities import log
  from mindsdb.utilities.profiler import profiler
label_desc: Use image node_id 9 for calling the PgVectorHandler obj's underlying member method code with example usage: obj.insert(table_name, data) without return types