How to convert to "end-of-month"?
<p>I have several dataframes that currently have all end-of-month data.</p>

<p>I now used following script to import Finance data:</p>

<pre><code>import csv
import pandas as pd
import numpy as np
import urllib.request  

urllib.request.urlretrieve(  
    'http://chart.finance.yahoo.com/table.csv?s=^GSPC&amp;a=4&amp;b=1&amp;c=2013&amp;d=5&amp;e=1&amp;f=2016&amp;g=m&amp;ignore=.csv',
    'gspc.csv'
)

table = pd.read_csv('gspc.csv')

    Date    Open    High    Low Close   Volume  Adj Close
49  2012-05-01  1,398   1,415   1,292   1,310   4158095900  1,310
48  2012-06-01  1,310   1,363   1,267   1,362   4103472300  1,362
47  2012-07-02  1,362   1,392   1,325   1,379   3663113300  1,379
</code></pre>

<p>As I said, I need to get this data into end-of-month.
I.e.</p>

<pre><code>    Date    Open    High    Low Close   Volume  Adj Close
49  2012-05-31  1,398   1,415   1,292   1,310   4158095900  1,310
48  2012-06-30  1,310   1,363   1,267   1,362   4103472300  1,362
47  2012-07-31  1,362   1,392   1,325   1,379   3663113300  1,379
</code></pre>

<p>I tried</p>

<pre><code>table['Date'] = pd.to_datetime(table['Date'])
table.set_index('Date').resample('M')
table
</code></pre>

<p>but weren't successful, though "M" should be "<a href="http://pandas.pydata.org/pandas-docs/stable/timeseries.html" rel="noreferrer">month end frequency</a>".</p>