title: How do I test if an object is a pandas datetime index?
body: <p>If I use <code>type</code> on a <code>DataFrame</code> which I know has a datetime index, I get:</p>
  
  <pre><code>In [17]: type(df.index)
  Out[17]: pandas.tseries.index.DatetimeIndex
  </code></pre>
  
  <p>but when I test it, I get:</p>
  
  <pre><code>In [18]: type(df.index) == 'pandas.tseries.index.DatetimeIndex'
  Out[18]: False
  </code></pre>
  
  <p>I know I assumed the type of type is a string, but I really don't know what else to try, and searching has resulted in nothing.</p>