<h3 dir="auto">Describe the issue:</h3>
<p dir="auto">According to the <a href="https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.cdouble" rel="nofollow">documentation</a> I should be able to create a complex number with <code class="notranslate">numpy.cdouble(real=1.0, imag=2.0)</code> but this returns</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TypeError: function takes at most 1 argument (2 given)"><pre class="notranslate"><code class="notranslate">TypeError: function takes at most 1 argument (2 given)
</code></pre></div>
<p dir="auto">Same applies to <code class="notranslate">complex_</code> and <code class="notranslate">complex128</code>, since they are all the same as far as I understand.<br>
Not sure if this is a bug in the code or an outdated section in the documentation.<br>
I tested this with Numpy 1.22.3 compiled from source and with Numpy 1.22.4 installed from PyPi, both on Windows 10.</p>
<h3 dir="auto">Reproduce the code example:</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy
numpy.cdouble(real=1.0, imag=2.0)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span>
<span class="pl-s1">numpy</span>.<span class="pl-en">cdouble</span>(<span class="pl-s1">real</span><span class="pl-c1">=</span><span class="pl-c1">1.0</span>, <span class="pl-s1">imag</span><span class="pl-c1">=</span><span class="pl-c1">2.0</span>)</pre></div>
<h3 dir="auto">Error message:</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="TypeError: function takes at most 1 argument (2 given)"><pre class="notranslate">TypeError: <span class="pl-k">function</span> <span class="pl-en">takes</span> at most 1 argument (2 given)</pre></div>
<h3 dir="auto">NumPy/Python version information:</h3>
<p dir="auto"><code class="notranslate">1.22.3 3.8.12 (default, May 19 2022, 11:54:29) [MSC v.1929 64 bit (AMD64)]</code></p>
<h3 dir="auto">Describe the issue:</h3>
<p dir="auto">The resulting order of np.argsort appears to be incorrect and does not match with the order returned by x[argsort_idx].</p>
<p dir="auto">Specifically, when sorting in descending order, the highlighted number should be in position 11, not 9.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/4619414/145800130-2a1be2f3-7bff-4dea-8b2e-7ea3b2e265ba.png"><img src="https://user-images.githubusercontent.com/4619414/145800130-2a1be2f3-7bff-4dea-8b2e-7ea3b2e265ba.png" alt="Screenshot 2021-12-13 at 10 49 06" style="max-width: 100%;"></a></p>
<p dir="auto">Strangely enough, this results in the correct ordering of the values:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/4619414/145800374-87243c1b-3cfa-40ad-b696-79d43d952e85.png"><img src="https://user-images.githubusercontent.com/4619414/145800374-87243c1b-3cfa-40ad-b696-79d43d952e85.png" alt="Screenshot 2021-12-13 at 11 15 27" style="max-width: 100%;"></a></p>
<p dir="auto">Not entirely sure what can be going on here. Thanks!</p>
<h3 dir="auto">Reproduce the 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

x = np.array([ 26.929932  ,  17.864126  ,   5.439558  ,  -0.10773016,
        -9.52839   ,  -7.620389  , -11.919527  , -15.451256  ,
       -16.36096   , -18.313873  , -19.791018  , -18.288052  ,
       -21.068373  , -24.030613  , -23.9124    , -25.630302  ,
       -29.34889   , -29.329416  , -29.221819  , -26.609049  ,
       -29.375376  , -28.213442  , -28.636854  , -28.140215  ,
       -27.100985  ])

# Returns incorrect order of indices
list(zip(x, np.argsort(-1*x)))

# Returns correct order of list
x[np.argsort(-1*x)]"><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-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([ <span class="pl-c1">26.929932</span>  ,  <span class="pl-c1">17.864126</span>  ,   <span class="pl-c1">5.439558</span>  ,  <span class="pl-c1">-</span><span class="pl-c1">0.10773016</span>,
        <span class="pl-c1">-</span><span class="pl-c1">9.52839</span>   ,  <span class="pl-c1">-</span><span class="pl-c1">7.620389</span>  , <span class="pl-c1">-</span><span class="pl-c1">11.919527</span>  , <span class="pl-c1">-</span><span class="pl-c1">15.451256</span>  ,
       <span class="pl-c1">-</span><span class="pl-c1">16.36096</span>   , <span class="pl-c1">-</span><span class="pl-c1">18.313873</span>  , <span class="pl-c1">-</span><span class="pl-c1">19.791018</span>  , <span class="pl-c1">-</span><span class="pl-c1">18.288052</span>  ,
       <span class="pl-c1">-</span><span class="pl-c1">21.068373</span>  , <span class="pl-c1">-</span><span class="pl-c1">24.030613</span>  , <span class="pl-c1">-</span><span class="pl-c1">23.9124</span>    , <span class="pl-c1">-</span><span class="pl-c1">25.630302</span>  ,
       <span class="pl-c1">-</span><span class="pl-c1">29.34889</span>   , <span class="pl-c1">-</span><span class="pl-c1">29.329416</span>  , <span class="pl-c1">-</span><span class="pl-c1">29.221819</span>  , <span class="pl-c1">-</span><span class="pl-c1">26.609049</span>  ,
       <span class="pl-c1">-</span><span class="pl-c1">29.375376</span>  , <span class="pl-c1">-</span><span class="pl-c1">28.213442</span>  , <span class="pl-c1">-</span><span class="pl-c1">28.636854</span>  , <span class="pl-c1">-</span><span class="pl-c1">28.140215</span>  ,
       <span class="pl-c1">-</span><span class="pl-c1">27.100985</span>  ])

<span class="pl-c"># Returns incorrect order of indices</span>
<span class="pl-en">list</span>(<span class="pl-en">zip</span>(<span class="pl-s1">x</span>, <span class="pl-s1">np</span>.<span class="pl-en">argsort</span>(<span class="pl-c1">-</span><span class="pl-c1">1</span><span class="pl-c1">*</span><span class="pl-s1">x</span>)))

<span class="pl-c"># Returns correct order of list</span>
<span class="pl-s1">x</span>[<span class="pl-s1">np</span>.<span class="pl-en">argsort</span>(<span class="pl-c1">-</span><span class="pl-c1">1</span><span class="pl-c1">*</span><span class="pl-s1">x</span>)]</pre></div>
<h3 dir="auto">Error message:</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">NumPy/Python version information:</h3>
<p dir="auto">numpy 1.18.1<br>
python 3.7.10</p>