<h3 dir="auto">Describe the issue:</h3>
<p dir="auto">if the input data is a list which has float value and str value, then use stack function, the line which has both float value and str value will convert to str.</p>
<p dir="auto"><strong>suggest</strong>:<br>
pass in the dtype into asanyarray function in below line:<br>
arrays = [asanyarray(arr, dtype=dtype) for arr in arrays]</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="e.g., the input list is: 
      list1 =
         [[1.0, 34.4, 56.6],
         [2.0, 'abc', 35.1],
         [3.0, 234, 45.9]]
then:
      data = empty((3,3), dtype=object)
      np.stack(list1, out=data, dtype = object)
result:  the second row's values will be converted to str."><pre class="notranslate"><span class="pl-s1">e</span>.<span class="pl-s1">g</span>., <span class="pl-s1">the</span> <span class="pl-s1">input</span> <span class="pl-s1">list</span> <span class="pl-c1">is</span>: 
      <span class="pl-s1">list1</span> <span class="pl-c1">=</span>
         [[<span class="pl-c1">1.0</span>, <span class="pl-c1">34.4</span>, <span class="pl-c1">56.6</span>],
         [<span class="pl-c1">2.0</span>, <span class="pl-s">'abc'</span>, <span class="pl-c1">35.1</span>],
         [<span class="pl-c1">3.0</span>, <span class="pl-c1">234</span>, <span class="pl-c1">45.9</span>]]
<span class="pl-s1">then</span>:
      <span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-en">empty</span>((<span class="pl-c1">3</span>,<span class="pl-c1">3</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">object</span>)
      <span class="pl-s1">np</span>.<span class="pl-en">stack</span>(<span class="pl-s1">list1</span>, <span class="pl-s1">out</span><span class="pl-c1">=</span><span class="pl-s1">data</span>, <span class="pl-s1">dtype</span> <span class="pl-c1">=</span> <span class="pl-s1">object</span>)
<span class="pl-s1">result</span>:  <span class="pl-s1">the</span> <span class="pl-s1">second</span> <span class="pl-s1">row</span>'<span class="pl-s1">s</span> <span class="pl-s1">values</span> <span class="pl-s1">will</span> <span class="pl-s1">be</span> <span class="pl-s1">converted</span> <span class="pl-s1">to</span> <span class="pl-s1">str</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">mian branch, 1.24</p>
<h3 dir="auto">Context for the issue:</h3>
<p dir="auto"><em>No response</em></p>
<p dir="auto">I've reproduced this behavior on macOS and Linux with numpy 1.12.1:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; np.argsort(np.array([115, 70, 29]))
array([2, 1, 0])
&gt;&gt;&gt; np.argsort(np.array([115, 70, 29, 0, 0]))
array([3, 4, 2, 1, 0])
&gt;&gt;&gt; np.argsort(np.array([115, 70, 29, 0, 0]), axis=-1, kind='mergesort')
array([3, 4, 2, 1, 0])
&gt;&gt;&gt; np.argsort(np.array([115, 70, 29, 0, 0]), axis=-1, kind='heapsort')
array([4, 3, 2, 1, 0])
&gt;&gt;&gt; np.argsort(np.array([0, 0, 115, 70, 29, 0, 0]), axis=-1, kind='heapsort')
array([5, 0, 1, 6, 4, 3, 2])
&gt;&gt;&gt; np.argsort(np.array([0, 0, 115, 70, 29, 0, 0]), axis=-1, kind='mergesort')
array([0, 1, 5, 6, 4, 3, 2])"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; np.argsort(np.array([115, 70, 29]))
array([2, 1, 0])
&gt;&gt;&gt; np.argsort(np.array([115, 70, 29, 0, 0]))
array([3, 4, 2, 1, 0])
&gt;&gt;&gt; np.argsort(np.array([115, 70, 29, 0, 0]), axis=-1, kind='mergesort')
array([3, 4, 2, 1, 0])
&gt;&gt;&gt; np.argsort(np.array([115, 70, 29, 0, 0]), axis=-1, kind='heapsort')
array([4, 3, 2, 1, 0])
&gt;&gt;&gt; np.argsort(np.array([0, 0, 115, 70, 29, 0, 0]), axis=-1, kind='heapsort')
array([5, 0, 1, 6, 4, 3, 2])
&gt;&gt;&gt; np.argsort(np.array([0, 0, 115, 70, 29, 0, 0]), axis=-1, kind='mergesort')
array([0, 1, 5, 6, 4, 3, 2])
</code></pre></div>
<p dir="auto"><a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.argsort.html" rel="nofollow">TFM states</a>: "<code class="notranslate">numpy.argsort</code>: Returns the indices that would sort an array." I expect the indices corresponding to 29, 70, and 115 to be the highest three in the result and appear in that order. They do not do so predictably.</p>