title: Convert daily pandas stock data to monthly data using first trade day of the month
body: <p>I have a set of calculated OHLCVA daily securities data in a pandas dataframe like this:</p>
  
  <pre><code>&gt;&gt;&gt; type(data_dy)
  &lt;class 'pandas.core.frame.DataFrame'&gt;
  &gt;&gt;&gt; data_dy
                Open    High     Low   Close     Volume  Adj Close
  Date                                                            
  2012-12-28  140.64  141.42  139.87  140.03  148806700     134.63
  2012-12-31  139.66  142.56  139.54  142.41  243935200     136.92
  2013-01-02  145.11  146.15  144.73  146.06  192059000     140.43
  2013-01-03  145.99  146.37  145.34  145.73  144761800     140.11
  2013-01-04  145.97  146.61  145.67  146.37  116817700     140.72
  
  [5 rows x 6 columns]
  </code></pre>
  
  <p>I'm using the following dictionary and the pandas resample function to convert the dataframe to monthly data:</p>
  
  <pre><code>&gt;&gt;&gt; ohlc_dict = {'Open':'first','High':'max','Low':'min','Close': 'last','Volume': 'sum','Adj Close': 'last'}
  
  &gt;&gt;&gt; data_dy.resample('M', how=ohlc_dict, closed='right', label='right')
                 Volume  Adj Close    High     Low   Close    Open
  Date                                                            
  2012-12-31  392741900     136.92  142.56  139.54  142.41  140.64
  2013-01-31  453638500     140.72  146.61  144.73  146.37  145.11
  
  [2 rows x 6 columns]
  </code></pre>
  
  <p>This does the calculations correctly, but I'd like to use the Yahoo! date convention for monthly data of using the first trading day of the period rather than the last calendar day of the period that pandas uses.</p>
  
  <p>So I'd like the answer set to be:</p>
  
  <pre><code>               Volume  Adj Close    High     Low   Close    Open
  Date                                                            
  2012-12-28  392741900     136.92  142.56  139.54  142.41  140.64
  2013-01-02  453638500     140.72  146.61  144.73  146.37  145.11
  </code></pre>
  
  <p>I could do this by converting the daily data to a python list, process the data and return the data to a dataframe, but how do can this be done with pandas? </p>