title: Pandas - Get two digit year out of a date
body: <p>I have a date column in a pandas DataFrame which shows the date that the future contract expires. I need to use that information to create a new column with a name that my back tester accepts. The format I need it in is: </p>
  
  <pre><code>metadata['backtester_name'] = 'NF' + month_code + 2_digit_year
  </code></pre>
  
  <p>I know how to get the month_code, I need help to figure out how to get the 2_digit_year for this column.</p>
  
  <p>This is what the expiry column looks like, it's formatted as an object by default:</p>
  
  <pre><code>expiry
  2009-01-29
  2010-01-28
  2011-01-27
  </code></pre>
  
  <p>This is the formula that I'm playing around with:</p>
  
  <pre><code>metadata['backtesting_name'] = 'NF' + pd.DatetimeIndex(metadata['expiry']).month.map(month_code) + str(pd.to_datetime(metadata['expiry']))[2:]
  </code></pre>
  
  <p>My issue is that the year is not getting captured correctly, it returns some kind of series:</p>
  
  <pre><code>backtesting_name
  0    NFF0     2009-01-29\n1     2010-01-28\n2     2...
  1    NFF0     2009-01-29\n1     2010-01-28\n2     2...
  2    NFF0     2009-01-29\n1     2010-01-28\n2     2...
  3    NFF0     2009-01-29\n1     2010-01-28\n2     2...
  4    NFF0     2009-01-29\n1     2010-01-28\n2     2...
  </code></pre>
  
  <p>Your help would be appreciated, let me know if I need to share any other information.</p>