title: Converting timeseries into datetime format in python
body: <p>I have the column of dates called <code>'Activity_Period'</code> in this format <code>'200507'</code> which means July 2005 and I want to convert it to datetime format of <code>('Y'-'m')</code> in python.</p>
  
  <p>I tried to use the <code>datetime.strp</code> however it shows that the input has to be a string and not a series.</p>
  
  <pre><code>df.Activity_Period=datetime.strptime(df.Activity_Period, '%Y-%m')
  </code></pre>
  
  <p>The following is the error I get</p>
  
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-40-ac32eb324a0b&gt; in &lt;module&gt;
  ----&gt; 1 df.Activity_Period=datetime.strptime(df.Activity_Period, '%Y-%m')
  
  TypeError: strptime() argument 1 must be str, not Series
  </code></pre>