title: Pandas previous month begin
body: <p>Given a dataframe:</p>
  
  <pre><code>df = pd.DataFrame({'c':[0,1,1,2,2,2],'date':pd.to_datetime(['2016-01-01','2016-02-01','2016-03-01','2016-04-01','2016-05-01','2016-06-05'])})
  </code></pre>
  
  <p>How to get the previous month begin for each date? The below doesn't work for 6/5 and there is some extra time portion. </p>
  
  <pre><code>pd.to_datetime(df['date'], format="%Y%m") + pd.Timedelta(-1,unit='M') + MonthBegin(0)
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have a workaround (2 steps back and 1 step forward):</p>
  
  <pre><code>(df['date']+ pd.Timedelta(-2,unit='M')+ MonthBegin(1)).dt.date
  </code></pre>
  
  <p>Don't like this. There should be something better.</p>