title: Mixed datetime and categorical hierarchical index (multiindex) in pandas
body: <p>A dataframe <code>df</code> includes columns on <code>df['country']</code>, <code>df['sector']</code> and <code>df['year']</code> and there is other numerical data which is mixed <code>int</code> and <code>float</code>. Country and sector are <code>categorical</code> variables, year is <code>datetime64[ns]</code>.</p>
  
  <p>I have created a 3-layer hierarchy as follows</p>
  
  <pre><code>arrays1 = [np.array(df['country']), np.array(df['sector']), np.array(df['year'])] 
  df1 = df.set_index(arrays1)
  df1.index.names = ['country','sector', 'year']
  df1 = df1.sort_index()
  </code></pre>
  
  <p>How should you create this multiindex to ensure the third level <code>year</code> is recognized as a datetimeIndex of frequency annual?</p>