title: How to update postgres table column based values coming from dataframe using Python
body: <p>I have table called Risk which 4 columns.This tables column <code>risk_state</code>value needs to be updated with value of <code>riskState</code> from Dataframe (DF).</p>
  <p>How to write update statement for my uodate query from python. I am not sure how to pass the value from dataframe to Table for updation.</p>
  <p><strong>Risk</strong></p>
  <pre><code>risk_id  shipment_id customer_code  risk_state
   125AB     ASW11       JJ           TBW
   326BW     GY456       JJ           TBW
   676BY     ABW11       JJ           TBW
   678BY     BYM11       RR           VT
  </code></pre>
  <p><strong>Dataframe (DF)</strong></p>
  <pre><code>riskId   shipmentId customerCode  riskState
   125AB     ASW11       JJ           VT
   326BW     GY456       JJ           VB
   676BY     ABW11       JJ           VT
   678BY     BYM11       RR           VT
  </code></pre>
  <p><strong>Expected Output of Risk Table</strong></p>
  <pre><code>risk_id  shipment_id customer_code  risk_state
       125AB     ASW11       JJ           VT
       326BW     GY456       JJ           VB
       676BY     ABW11       JJ           VT
       678BY     BYM11       RR           VT
  </code></pre>
  <p><strong>Code</strong></p>
  <p>#Connection String</p>
  <pre><code>postgres_str = f'postgresql://{username}:{password}@{host}:{port}/{dbname}'
  # Create the connection and cursor
  rds_conn = psycopg2.connect(postgres_str)
  rds_cur = rds_conn.cursor()
  rds_cur.execute(&quot;&quot;&quot;update risk where...&quot;&quot;&quot;)
  </code></pre>
  <p>rds_conn.commit()</p>
  <p>How could this be done...</p>