title: cannot do slice indexing on <class 'pandas.core.indexes.period.PeriodIndex'> with these indexers
body: <pre><code>file_location3 = "F:/python/course1_downloads/City_Zhvi_AllHomes.csv"
  
  housing = pd.read_csv(file_location3)    
  housing.set_index(['State','RegionName'],inplace=True)
  housing = housing.iloc[:, 49:]
  
  housing = housing.groupby(pd.PeriodIndex(housing.columns,freq='Q'),axis=1).mean()
  
  data = housing
  data = data.iloc[:,'2008q3' : '2009q2']
  </code></pre>
  
  <p>The error that I am getting is:</p>
  
  <blockquote>
    <p>cannot do slice indexing on <code>'&lt;class
    'pandas.core.indexes.period.PeriodIndex'&gt;</code> with these indexers <code>[2008q3]</code>
    of <code>&lt;'class 'str'&gt;</code></p>
  </blockquote>
  
  <h2>Now I'm getting another error</h2>
  
  <pre><code>def price_ratio(row):
      return (row['2008q3'] - row['2009q2']) / row['2008q3']
  
  data['up&amp;down'] = data.apply(price_ratio, axis=1)
  </code></pre>
  
  <p>This gives me error: <code>KeyError: ('2008q3', 'occurred at index 0')</code></p>