title: How to pass column name into parameter in pandas
body: <p>I am trying to create a xml from a dataframe .  Issue that I am facing i want pass column into paramter and its not working.</p>
  
  <pre><code>    ORDER_NO        1175        1304          1421  
     7283630          2019-12-04  2019-12-10   2019-12-12 
     7283650          2019-12-25  NaN          2019-12-20
  </code></pre>
  
  <p><strong>My code</strong></p>
  
  <pre><code>header = """&lt;ORD&gt;{}&lt;/ORD&gt;"""
  body ="""
  &lt;osi:ORDSTSINF types:STSCDE="{}"&gt;
  &lt;DTM&gt;{}&lt;/DTM&gt;
  &lt;/osi:ORDSTSINF&gt;
  &lt;osi:ORDSTSINF types:STSCDE="{}"&gt;
  &lt;DTM&gt;{}&lt;/DTM&gt;
  &lt;/osi:ORDSTSINF&gt;
  &lt;osi:ORDSTSINF types:STSCDE="{}"&gt;
  &lt;DTM&gt;{}&lt;/DTM&gt;
  &lt;/osi:ORDSTSINF&gt;"""
  
  for row in df.itertuples():
      with open(f'{row[1]}.xml', 'w') as f:
          f.write(header.format(row[1]))
          f.write(body.format(col[2], row[2], col[3],row[3],col[4],row[4]))
  </code></pre>
  
  <p>I want to pass then columnname wherever STS={} is coming.</p>
  
  <p><strong>Expected output</strong></p>
  
  <pre><code>&lt;ORD&gt; 7283630&lt;/ORD&gt;
  &lt;osi:ORDSTSINF types:STSCDE="1175"&gt;
  &lt;DTM&gt;2019-12-04&lt;/DTM&gt;
  &lt;osi:ORDSTSINF types:STSCDE="1304"&gt;
  &lt;DTM&gt;2019-12-10&lt;/DTM&gt;
  &lt;osi:ORDSTSINF types:STSCDE="1421"&gt;
  &lt;DTM&gt;22019-12-12&lt;/DTM&gt;
  </code></pre>
  
  <p>How can this be done in python?</p>