title: Pandas : store each row data into a dictionary with column name as key
body: <p>I have the below csv/excel data</p>
  <pre><code>uniqueid  name   age  marks
  
  efsdf     David  20   80
  
  fdsdf     Mark   23    
  
  sdfs      John        40
  </code></pre>
  <p>sometimes values can be missed in cells, but uniqueid must be there, according to uniqueid provided I will update data in database
  I want to store every row data into dictionary and pass into a method like</p>
  <pre><code>dict = {
   &quot;uniqueid&quot;:&quot;efsdf&quot;,
   &quot;name&quot; : &quot;David&quot;,
   &quot;age&quot; : &quot;20&quot;,
    &quot;marks&quot;:&quot;80&quot;
  }
  
  </code></pre>
  <p>this is the method-&gt; updatevalue(dict). for each row, I need to do this(pass dictionary to method).</p>
  <p>How to do this for every row and also get the column names as keys into dictionary for each row?</p>