import pandas as pd
from sqlalchemy import create_engine

# Load your data into a pandas DataFrame (replace 'data.csv' with your data source)
df = pd.read_csv('data.csv')

# Define your database connection string (replace 'username', 'password', 'host', 'port', 'database' with your actual credentials)
connection_string = 'postgresql://username:password@host:port/database'

# Create an SQLAlchemy engine
engine = create_engine(connection_string)

# Iterate over each row in the DataFrame
for index, row in df.iterrows():
    # Insert data into the remote database
    row.to_sql('table_name', engine, if_exists='append', index=False)  # replace 'table_name' with your actual table name

# Close the database connection
engine.dispose()