title: Pandas - Return last/first day of the month in a custom Datetime Index
body: <p>I'm using a multi index columns dataframe with custom dates (specific holidays,weekdays..).</p>
  
  <pre><code>DatetimeIndex(['1989-01-31', '1989-02-01', '1989-02-02', '1989-02-03',
             '1989-02-06', '1989-02-07', '1989-02-08', '1989-02-09',
             '1989-02-10', '1989-02-13',
             ...
             '2019-02-25', '2019-02-26', '2019-02-27', '2019-02-28',
             '2019-03-01', '2019-03-04', '2019-03-05', '2019-03-06',
             '2019-03-07', '2019-03-08'],
            dtype='datetime64[ns]', length=7585, freq=None)
  </code></pre>
  
  <p>I need to slice it for first or last day of the month from the index.
  Due to holidays,... some first/last day of the month of the index would not match with freq = 'BM'. No need to mention i cannot use resample(),...</p>
  
  <p>Here an example:</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  idx = pd.DatetimeIndex(['1989-01-31', '1989-02-01', '1989-02-02', '1989-02-03','1989-02-06', '1989-02-07', '1989-02-08', '1989-02-09','1989-02-10', '1989-02-13', '2019-02-25', '2019-02-26', '2019-02-27', '2019-02-28','2019-03-01', '2019-03-04', '2019-03-05', '2019-03-06','2019-03-07', '2019-03-08'], dtype='datetime64[ns]')
  
  numbers = [0, 1, 2]
  colors = [u'green', u'purple']
  col = pd.MultiIndex.from_product([numbers, colors],names=['number', 'color'])
  
  df = pd.DataFrame(np.random.rand(len(idx),len(col)),index =idx,columns=col)
  </code></pre>
  
  <pre><code>number            0                 1                 2         
  color         green   purple    green   purple    green   purple
  2018-06-05  0.64943  0.64943  0.64943  0.64943  0.64943  0.64943
  etc...
  </code></pre>
  
  <p>Expected Output:</p>
  
  <pre><code>2018-06-29  0.64943  0.64943  0.64943  0.64943  0.64943  0.64943
  </code></pre>
  
  <p>How could i do this please ?</p>
  
  <p>thanks</p>