title: Converting PeriodIndex to
body: <p>I had a dataframe that used <code>pd.Period</code> for the indexing, but later needed to use that data for plotting the x_axis in Bokeh. </p>
  
  <pre><code>df = return_data_with_multiindex()
  df.reset_index(inplace=True, drop=False)
  type(df["calDate"][0]) # returns pandas._period.Period
  </code></pre>
  
  <p>Unfortunately Bokeh doesn't support period so I'm stuck on how to best convert it.</p>
  
  <pre><code>TypeError: Object of type 'Period' is not JSON serializable
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/29394730/converting-periodindex-to-datetimeindex">This answer didn't help</a>, as I still kept throwing type errors:</p>
  
  <pre><code>AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-287-8753a9594163&gt; in &lt;module&gt;()
        1 #pd.to_datetime(df["calDate"], format='%Y-%m')
  ----&gt; 2 df["calDate"].to_timestamp()
        3 df[["calDate","freq_hist_deseas","freq_futr","freq_tr12"]]
        4 #type(df["calDate"][0])
  
  C:\ANACONDA36\lib\site-packages\pandas\core\series.py in to_timestamp(self, freq, how, copy)
     2709             new_values = new_values.copy()
     2710 
  -&gt; 2711         new_index = self.index.to_timestamp(freq=freq, how=how)
     2712         return self._constructor(new_values,
     2713                                  index=new_index).__finalize__(self)
  
  AttributeError: 'RangeIndex' object has no attribute 'to_timestamp'
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>EDIT: Here's an example:</p>
  
  <pre><code>                  col1 col2 col3
  i1 i2   pd.Period                                                                                   
  x   y   2006-07    1   2   3
                     1   2   3
  </code></pre>
  
  <p>EDIT2: caldate</p>
  
  <pre><code>df.reset_index(inplace=True, drop=False)
  df["calDate"].head()
  
  0   2006-07
  1   2006-08
  2   2006-09
  3   2006-10
  4   2006-11
  Name: calDate, dtype: object
  </code></pre>