title: Pandas: Comparing a row value and modify next column's row values
body: <p>I have this Pandas Dataframe:</p>
  
  <pre><code>    A                             B
  0   xyz                          Lena
  1   NaN                          J.Brooke
  2   NaN                          B.Izzie
  3   NaN                          B.Rhodes
  4   NaN                          J.Keith        
  .....  
  </code></pre>
  
  <p>I want to compare the values of column B such that if row value begins with B then in it's adjacent row of column A new should be written and similarly if J then old. Below is what I'm expecting:</p>
  
  <pre><code>    A                             B
  0   xyz                         Lena
  1   old                         J.Brooke
  2   new                         B.Izzie
  3   new                         B.Rhodes
  4   old                         J.Keith        
  .....  
  </code></pre>
  
  <p>I'm unable to understand how I can do this. To begin with I can use <code>startswith()</code> but then how to compare one row value and then to have the required field values right in the adjacent row of another column?
  This is a small case I'm trying a lot og messier things...Pandas is indeed powerful!</p>