title: Pandas time period data type prints as numbers?
body: <p>I have a Pandas Dataframe which contains dates which I converted to a pandas TimeSeries.</p>
  
  <p>From there, I wanted to add a column to the DF which would be the same as the date column, just in Period format with frequency set to months.</p>
  
  <p>The problem is, within the dataframe, the period column prints as numbers (2009-1 prints as 468, 2009-2 prints as 469, etc).</p>
  
  <p>When I create a separate PeriodIndex object outside of the DF, this is not an issue.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Code I used to convert unformatted time column to DateTime:</p>
  
  <pre><code>subset['Created On'] = pd.to_datetime(subset['Created On'])
  </code></pre>
  
  <p>Code for creating column with Periods:</p>
  
  <pre><code>subset['Month'] = pd.PeriodIndex(subset['Created On'],freq='M')
  </code></pre>
  
  <p>Code that creates a separate PeriodIndex object and properly displays dates in month format:</p>
  
  <pre><code>months = pd.PeriodIndex(subset['Created On'],freq='M')
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>As requested in the comments, subset[:1].to_dict() outputs:</p>
  
  <pre><code>#[Out]# {'Created On': {12822544: &lt;Timestamp: 2009-01-01 00:00:00&gt;}, 'City': {12822544: 'BROOKLYN'}, 'Borough': {12822544: 'Unspecified'}, 'Location': {12822544: '(40.65662129596871, -73.95806621423951)'}, 'Closed Date': {12822544: '01/07/2009 12:00 AM'}}
  </code></pre>
  
  <p>Note that since my OP, I lost my session and had to re-upload the data to a DF. At this point, I've only converted the column 'Created On' to a timestamp using the pd.to_datetime method. Since then, I've tried using:</p>
  
  <pre><code>subset['Created On'].resample('M')
  </code></pre>
  
  <p>Which results in the error:</p>
  
  <pre><code>TypeError: Only valid with DatetimIndex or PeriodIndex
  </code></pre>
  
  <p>Maybe a part of the issue is that I'm not using the date column as the DF index? If so, that wouldn't work well since it contains a ton of non-unique values and I'm already using a Unique ID field which is more representative of an index.</p>