title: How to change values of pandas dataframe based on the first row value
body: <p>I have this dataframe:</p>
  <pre><code>dir
  
  buy
  buy
  buy
  buy
  </code></pre>
  <p>I want that if the value of the first row is &quot;buy&quot;, so do this:</p>
  <pre><code>dir
  
  buy
  sell
  buy
  sell
  </code></pre>
  <p>If, instead, the value of the first row is &quot;sell&quot;, do this:</p>
  <pre><code>dir
  
  sell
  buy 
  sell
  buy
  </code></pre>
  <p>any ideas?</p>