title: how to edit an existing row value on the basis of the previous row value in python
body: <p>I have a dataset as below:</p>
  
  <pre><code>date time value
  20141102 1420 0
  20141102 1425 2
  20141103 1430 N/A
  20141103 1435 N/A
  20141104 1440 2
  20141104 1445 N/A
  20141105 1450 N/A
  20141105 1455 2
  </code></pre>
  
  <p>But I want to edit the column value.
  1. I want the value to be 0 instead of 2 if the previous value is N/A. The desired output should be like this:</p>
  
  <pre><code> date time value
   20141102 1420 0
   20141102 1425 2
   20141103 1430 N/A
   20141103 1435 N/A
   20141104 1440 0
   20141104 1445 N/A
   20141105 1450 N/A
   20141105 1455 0
  </code></pre>