title: Index/Slicing Pandas DataFrame with Numpy datetime64 objects
body: <p>I'd like to be able to figure out if I can get the following to work (Pandas 0.23.4). Any help would be most appreciated.</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  
  rows = 12
  rng = pd.date_range('2011-01', periods=rows, freq='M')
  
  df = pd.DataFrame(np.arange(rows), index=rng)
  
  print(df.loc['2011-01'])
  print(df.loc[np.datetime64('2011-01')])
  </code></pre>
  
  <p>The first <code>print</code> does what I would expect: shows all the rows that are in Jan of 2011. However, the second one throws an <code>KeyError</code> because the value is not in the index. I was hoping that it would provide the same output, but after some testing I realize that it is looking for an exact match 2011-01-01, which is not in the DataFrame. I'd like for the second one to work, so that I can use <code>numpy.arange</code> or <code>pandas.date_range</code> to easily generate arrays of dates that I can loop through. Anyone got this to work?
  (Seems like <a href="https://stackoverflow.com/questions/37969061/how-to-slice-numpy-datetime64-array">this works</a>, but only if you have an exact match for the dates.)</p>