numpy datetime and pandas datetime
<p>I'm confused by the interoperation between numpy and pandas date objects (or maybe just by numpy's datetime64 in general).</p>

<p>I was trying to count business days using numpy's built-in functionality like so:</p>

<pre><code>np.busday_count("2016-03-01", "2016-03-31", holidays=[np.datetime64("28/03/2016")])
</code></pre>

<p>However, numpy apparently can't deal with the inverted date format:</p>

<pre><code>ValueError: Error parsing datetime string "28/03/2016" at position 2
</code></pre>

<p>To get around this, I thought I'd just use pandas to_datetime, which can. However:</p>

<pre><code>np.busday_count("2016-03-01", "2016-03-31", holidays=[np.datetime64(pd.to_datetime("28/03/2016"))])

ValueError: Cannot safely convert provided holidays input into an array of dates
</code></pre>

<p>Searching around for a bit, it seemed that this was caused by the fact that the chaining of to_datetime and np.datetime64 results in a <code>datetime64[us]</code> object, which apparently the <code>busday_count</code> function cannot accept (is this intended behaviour or a bug?). Thus, my next attempt was:</p>

<pre><code>np.busday_count("2016-03-01", "2016-03-31", holidays=[np.datetime64(pd.Timestamp("28"), "D")])
</code></pre>

<p>But:</p>

<pre><code>TypeError: Cannot cast datetime.datetime object from metadata [us] to [D] according to the rule 'same_kind'
</code></pre>

<p>And that's me out - why are there so many incompatibilities between all these datetime formats? And how can I get around them?</p>