title: Dataframe to table load in Python
body: <p>I am loading data from excel to data frames and then finally to a table in Snowflake in a Python script. While I have been able to load the data frame to the table, it is taking a long time to load. For example, it took me 5 minutes to load 100 records. I have been trying out other ways in which I can load the data but unfortunately, the references I found online have not been working for me. Would appreciate it if you can guide me to a better and more efficient way of doing this.</p>
  <p>Code Snippet of how I am loading the table:</p>
  <p>df_hdr and df_attrib_values are my dataframes.</p>
  <pre><code>def insert_dim():
   del_dim = cs.execute(&quot;TRUNCATE TABLE util_db.public.TABLE1;&quot;)
  
    for(row,rs) in df_hdr.iterrows():
       COLUMN3 = rs[0]
       COLUMN4 = rs[1]      
       #insert_dim =
       insert_dim = cs.execute(&quot;INSERT INTO util_db.public.TBL_DIM_10 VALUES (&quot; + &quot;'&quot; + COLUMN3 + &quot;'&quot; + 
                                 &quot;,&quot; + &quot;'&quot; \
            + COLUMN4 + &quot;'&quot; + &quot;);&quot;)
          
  def insert_mstr():
   del_dim = cs.execute(&quot;TRUNCATE TABLE util_db.public.TABLE2;&quot;)
  
   for(row,rs) in df_attrib_values.iterrows():
       col1 = str(rs[0])
       col2 = str(int(rs[1])) 
       COLUMN3 = rs[2]
       COLUMN4 = rs[3]
       insert_mstr = cs.execute(&quot;INSERT INTO util_db.public.TBL_MSTR_10 VALUES (&quot; + &quot;'&quot; + col1 + &quot;'&quot; + 
                                       &quot;,&quot; + &quot;'&quot; \
            + col2 + &quot;'&quot; + &quot;,&quot; + &quot;'&quot; + COLUMN3 + &quot;'&quot; + &quot;,&quot; + &quot;'&quot; + COLUMN4 + &quot;'&quot; + &quot;);&quot;)
  </code></pre>