title: How to return the original value in a .apply function
body: <p>I Am trying to use the .apply() method in Pandas.</p>
  
  <p>I want to changed certain rows and return with a new value but return the original value for others.</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>def pre(row):
      if row['HOURLYWindDirection'] == 'VRB':
          return 'Variable Direction'
      else row['HOURLYWindDirection'] == float : # I don't know what to write here
          return  #or here
  dfWeather['HOURLYWindDirection'] = dfWeather.apply(pre,axis='columns')
  </code></pre>
  
  <p>This returns:</p>
  
  <pre><code>0                      None
  1                      None
  2        Variable Direction
  3                      None
  4                      None
  </code></pre>
  
  <p>But I want it to return the original values not 'None'</p>
  
  <p>I've tried pass and continue in the 'Pre' function. </p>
  
  <p>Any advice? </p>
  
  <p>Have to use the .apply function</p>