title: Pandas create date range at certain dates
body: <p>I want to create a list (or array or whathever) of a given number of dates at monthly intervals. </p>
  
  <p>Basically what I want is this</p>
  
  <pre><code>&gt;&gt;&gt;some_function(start_date=date(2005, 5, 14), periods=4, freq='M')
  ['2005-05-14', '2005-06-14', '2005-07-14', '2005-08-14']
  </code></pre>
  
  <p>and if the day of the startmonth is close to end of the month I want this</p>
  
  <pre><code>&gt;&gt;&gt;some_function(start_date=date(2007, 12, 31), periods=4, freq='M')
  ['2007-12-31', '2008-01-31', '2008-02-29', '2008-03-31']
  </code></pre>
  
  <p>I am aware of the pandas date_range function, however it produces this</p>
  
  <pre><code>pd.date_range(date(2005, 5, 14), periods=4, freq='M')
  Out[1]: DatetimeIndex(['2005-05-31', '2005-06-30', '2005-07-31', '2005-08-31'],
            dtype='datetime64[ns]', freq='M')
  </code></pre>
  
  <p>i.e. it sets the month end as the day. Which is not what I want. </p>
  
  <p>Obviously, this could be produced iterating over the number of periods, but this creates a hassle when the day of the startmonth is close to the last day of the month. </p>
  
  <p>Does anybody know of a function producing this or is the method outlined above the only way?</p>