title: Resampling pandas columns datetime
body: <p>(I think) I have a dataset with the columns representing <code>datetime</code> intervals</p>
  
  <p>Columns were transformed in datetime with:</p>
  
  <pre><code>    for col in df.columns:
          df.rename({col: pd.to_datetime(col, infer_datetime_format=True)}, inplace=True)
  </code></pre>
  
  <p>Then, I need to <code>resample</code> the columns (year and month '2001-01') into quarters using <code>mean</code></p>
  
  <p>I tried  </p>
  
  <pre><code>df = df.resample('1q', how='mean', axis=1)
  </code></pre>
  
  <p>The <code>DataFrame</code> also has a multindex set <code>['RegionName', 'County']</code></p>
  
  <p>But I get the error:</p>
  
  <pre><code>Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of 'Index'
  </code></pre>
  
  <p>Is the problem in the <code>to_datetime</code> function or in the wrong sampling?</p>