擅长:python、mysql、java
<p>我假设df中的'Date'是<code>string</code>,因此需要转换。
如果没有,你将需要相应地调整。你知道吗</p>
<p>尝试跟踪</p>
<pre><code>from datetime import date,datetime #date needed for simulation.
import pandas as pd
l = ['01/01/2018','02/03/2018','04/08/2018']
df = pd.DataFrame({'Date':l})
df['Month']=df['Date'].apply(lambda x :datetime.strptime(x, '%m/%d/%Y').strftime('%B'))
</code></pre>
<p><strong>结果</strong></p>
<pre><code>>>> df
Date Month
0 01/01/2018 January
1 02/03/2018 February
2 04/08/2018 April
>>>
</code></pre>