<blockquote>
<p dir="auto">This function is a faster version of the builtin python bisect.bisect_left (side='left') and bisect.bisect_right (side='right') functions</p>
</blockquote>
<p dir="auto">No, it's not faster for basic cases.</p>
<h3 dir="auto">Reproducing code example:</h3>
<p dir="auto">Python bisect is 3x faster than searchsorted:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from bisect import bisect_right
from numpy import searchsorted

l = list(range(1024 * 8))
m = int(len(l)/3)
%timeit bisect_right(l, m)

a = np.asarray(l)
%timeit searchsorted(a, m)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">bisect</span> <span class="pl-k">import</span> <span class="pl-s1">bisect_right</span>
<span class="pl-k">from</span> <span class="pl-s1">numpy</span> <span class="pl-k">import</span> <span class="pl-s1">searchsorted</span>

<span class="pl-s1">l</span> <span class="pl-c1">=</span> <span class="pl-en">list</span>(<span class="pl-en">range</span>(<span class="pl-c1">1024</span> <span class="pl-c1">*</span> <span class="pl-c1">8</span>))
<span class="pl-s1">m</span> <span class="pl-c1">=</span> <span class="pl-en">int</span>(<span class="pl-en">len</span>(<span class="pl-s1">l</span>)<span class="pl-c1">/</span><span class="pl-c1">3</span>)
<span class="pl-c1">%</span><span class="pl-s1">timeit</span> <span class="pl-en">bisect_right</span>(<span class="pl-s1">l</span>, <span class="pl-s1">m</span>)

<span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">asarray</span>(<span class="pl-s1">l</span>)
<span class="pl-c1">%</span><span class="pl-s1">timeit</span> <span class="pl-en">searchsorted</span>(<span class="pl-s1">a</span>, <span class="pl-s1">m</span>)</pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="444 ns ± 14.7 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
1.57 µs ± 13.7 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)"><pre class="notranslate"><code class="notranslate">444 ns ± 14.7 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
1.57 µs ± 13.7 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
</code></pre></div>
<p dir="auto">For reference, numba's implementation of <code class="notranslate">searchsorted()</code> is a little faster than bisect:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from numba import njit

@njit
def searchsorted_jit(_a, _v):
    return searchsorted(_a, _v)

searchsorted_jit(a, m)
%timeit searchsorted_jit(a, m)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">numba</span> <span class="pl-k">import</span> <span class="pl-s1">njit</span>

<span class="pl-en">@<span class="pl-s1">njit</span></span>
<span class="pl-k">def</span> <span class="pl-en">searchsorted_jit</span>(<span class="pl-s1">_a</span>, <span class="pl-s1">_v</span>):
    <span class="pl-k">return</span> <span class="pl-en">searchsorted</span>(<span class="pl-s1">_a</span>, <span class="pl-s1">_v</span>)

<span class="pl-en">searchsorted_jit</span>(<span class="pl-s1">a</span>, <span class="pl-s1">m</span>)
<span class="pl-c1">%</span><span class="pl-s1">timeit</span> <span class="pl-en">searchsorted_jit</span>(<span class="pl-s1">a</span>, <span class="pl-s1">m</span>)</pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="391 ns ± 2.93 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)"><pre class="notranslate"><code class="notranslate">391 ns ± 2.93 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
</code></pre></div>
<h3 dir="auto">Numpy/Python version information:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="1.16.2 3.7.3 (default, Mar 27 2019, 09:23:39)
[Clang 10.0.0 (clang-1000.11.45.5)]"><pre class="notranslate"><code class="notranslate">1.16.2 3.7.3 (default, Mar 27 2019, 09:23:39)
[Clang 10.0.0 (clang-1000.11.45.5)]
</code></pre></div>
<h3 dir="auto">Reproducing code example:</h3>

<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
&lt;&lt; your code here &gt;&gt;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-c1">&lt;&lt;</span> <span class="pl-s1">your</span> <span class="pl-s1">code</span> <span class="pl-s1">here</span> <span class="pl-c1">&gt;&gt;</span></pre></div>

<h3 dir="auto">Error message:</h3>


<h3 dir="auto">Numpy/Python version information:</h3>

<p dir="auto">I tried to run" import numpy as np" but it shows me an error message. I uninstalled and reinstalled 2 times but the problem is still present. I installed anaconda via the site : "<a href="https://www.anaconda.com/distribution/" rel="nofollow">https://www.anaconda.com/distribution/</a>" and I launched the launcher for the installed one.The message is :</p>
<p dir="auto">ImportError:</p>
<p dir="auto">IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!</p>
<p dir="auto">Importing the multiarray numpy extension module failed.  Most<br>
likely you are trying to import a failed build of numpy.<br>
Here is how to proceed:</p>
<ul dir="auto">
<li>If you're working with a numpy git repository, try <code class="notranslate">git clean -xdf</code><br>
(removes all files not under version control) and rebuild numpy.</li>
<li>If you are simply trying to use the numpy version that you have installed:<br>
your installation is broken - please reinstall numpy.</li>
<li>If you have already reinstalled and that did not fix the problem, then:
<ol dir="auto">
<li>
<p dir="auto">Check that you are using the Python you expect (you're using C:\Users\harry\Anaconda3\pythonw.exe),<br>
and that you have no directories in your PATH or PYTHONPATH that can<br>
interfere with the Python and numpy versions you're trying to use.</p>
</li>
<li>
<p dir="auto">If (1) looks fine, you can open a new issue at<br>
<a href="https://github.com/numpy/numpy/issues">https://github.com/numpy/numpy/issues</a>.  Please include details on:</p>
<ul dir="auto">
<li>how you installed Python</li>
<li>how you installed numpy</li>
<li>your operating system</li>
<li>whether or not you have multiple versions of Python installed</li>
<li>if you built from source, your compiler versions and ideally a build log</li>
</ul>
<p dir="auto">Note: this error has many possible causes, so please don't comment on<br>
an existing issue about this - open a new one instead.</p>
</li>
</ol>
</li>
</ul>
<p dir="auto">Original error was: No module named 'numpy.core._multiarray_umath'</p>