pd.Timestamp versus np.datetime64: are they interchangeable for selected uses? : <p>This question is motivated by <a href="https://stackoverflow.com/a/49719901/9209546">an answer</a> to a <a href="https://stackoverflow.com/questions/49719627/boolean-mask-from-pandas-datetime-index-using-loc-accessor">question on improving performance</a> when performing comparisons with <code>DatetimeIndex</code> in <code>pandas</code>.</p>

<p>The solution converts the <code>DatetimeIndex</code> to a <code>numpy</code> array via <code>df.index.values</code> and compares the array to a <code>np.datetime64</code> object. This appears to be the most efficient way to retrieve the Boolean array from this comparison.</p>

<p>The feedback on this question from one of the developers of <code>pandas</code> was: "These are not the same generally. Offering up a numpy solution is often a special case and not recommended."</p>

<p>My questions are:</p>

<ol>
<li>Are they interchangeable for a subset of operations? I appreciate
<code>DatetimeIndex</code> offers more functionality, but I require only basic functionality such as slicing and indexing.</li>
<li>Are there any documented differences in <em>result</em> for operations that are translatable to <code>numpy</code>?</li>
</ol>

<p>In my research, I found some posts which mention "not always compatible" - but none of them seem to have any conclusive references / documentation, or specify why/when generally they are incompatible. Many other posts use the <code>numpy</code> representation without comment.</p>

<ul>
<li><a href="https://stackoverflow.com/questions/38676418/pandas-datetimeindex-indexing-dtype-datetime64-vs-timestamp">Pandas DatetimeIndex indexing dtype: datetime64 vs Timestamp</a></li>
<li><a href="https://stackoverflow.com/questions/13227865/how-to-convert-from-pandas-datetimeindex-to-numpy-datetime64">How to convert from pandas.DatetimeIndex to numpy.datetime64?</a></li>
</ul>
