<p dir="auto">maintenance/1.9.x:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [8]: ap = np.array([0, 2, 4, 6, 8, 10])

# Passing an empty 'k' array to partition is a no-op:
In [9]: ap.partition(np.array([], dtype=np.int64))

In [10]: ap
Out[10]: array([ 0,  2,  4,  6,  8, 10])"><pre class="notranslate"><code class="notranslate">In [8]: ap = np.array([0, 2, 4, 6, 8, 10])

# Passing an empty 'k' array to partition is a no-op:
In [9]: ap.partition(np.array([], dtype=np.int64))

In [10]: ap
Out[10]: array([ 0,  2,  4,  6,  8, 10])
</code></pre></div>
<p dir="auto">1.10.1:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [2]: ap = np.array([0, 2, 4, 6, 8, 10])

In [3]: ap.partition(np.array([], dtype=np.int64))
---------------------------------------------------------------------------
MemoryError                               Traceback (most recent call last)
&lt;ipython-input-3-c708b3f943a6&gt; in &lt;module&gt;()
----&gt; 1 ap.partition(np.array([], dtype=np.int64))

MemoryError: "><pre class="notranslate"><code class="notranslate">In [2]: ap = np.array([0, 2, 4, 6, 8, 10])

In [3]: ap.partition(np.array([], dtype=np.int64))
---------------------------------------------------------------------------
MemoryError                               Traceback (most recent call last)
&lt;ipython-input-3-c708b3f943a6&gt; in &lt;module&gt;()
----&gt; 1 ap.partition(np.array([], dtype=np.int64))

MemoryError: 
</code></pre></div>
<p dir="auto">Noticed this because it's breaking some tests in patsy.</p>
<p dir="auto">If np.unique is used with <code class="notranslate">return_index=True</code> and the input is empty, the resulting array has dtype <code class="notranslate">bool</code> instead of <code class="notranslate">int</code>.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: import numpy as np

In [2]: np.unique([], return_index=True)
Out[2]: (array([], dtype=float64), array([], dtype=bool))

In [3]: np.unique([1,], return_index=True)
Out[3]: (array([1]), array([0]))"><pre class="notranslate"><code class="notranslate">In [1]: import numpy as np

In [2]: np.unique([], return_index=True)
Out[2]: (array([], dtype=float64), array([], dtype=bool))

In [3]: np.unique([1,], return_index=True)
Out[3]: (array([1]), array([0]))
</code></pre></div>