title: pandas conditional statements and adding columns
body: <p>I am using Pandas to sort through an excel spreadsheet. I would like to execute an if/elif function to return a string in a new column within my dataframe. I am trying to return a new column named "action" that returns a string based off time values. </p>
  
  <pre><code>state     time      
   ca         1
   ca         5
   ca         7
   ca         10
  
  for rows in df:
  
   if df[time]&gt;=1:
      return "do nothing"
  
   elif df[time]&lt;=5:
       return "add more"
  
   elif df[time]&lt;=10:
        return "add less"
  
    else:
        return "error"
  </code></pre>