title: performing just one iteration of a function using python
body: <p>I have a function, but for testing purposes, I would like to run it just once and not have it iterate through the whole dataset.</p>
  
  <p>My code looks as follows:</p>
  
  <pre><code>def issue_ago(date):
      today = datetime.today()
      if type(date) == str:
          date = datetime.strptime(date, '%Y-%m-%d %H:%M:%S.%f')
          print date
          epoch = datetime(1970, 1, 1)
          diff = today - date
          date = diff.days /365.25
          return date
      else:
          return date
  </code></pre>
  
  <p>I am then running this across a column in my dataset to convert a date using the below code. The column in my dataset is a series:</p>
  
  <pre><code>data['Issue_Ago'] = data['issue_created_on'].apply(issue_ago)
  </code></pre>
  
  <p>I was considering using a ˋbreakˋ clause but that it seems requires use of a ˋforˋ loop.</p>
  
  <p>What would be recommendations on the best way to do this?</p>