<p dir="auto">This is a bit of a nitpick, but I think this would improve user-friendlyness.<br>
Currently <code class="notranslate">np.asarray([[1, 2], [2, 3, 4]], dtype=np.float)</code> yields "setting an array element with a sequence."</p>
<p dir="auto">I think it would be more helpful if it yielded something like "Can't create array from lists. Column length %d of column %d doesn't match column length %d."</p>
<p dir="auto">I imagine the error bubbles up from somewhere deep in the code and makes perfect sense where it is raised. It is just something that comes up a lot, and a more friendly and / or informative message could be helpful. So maybe we could catch it further up and include more information if possible.</p>
<p dir="auto">Someone using my code reported this error message, and I would have been able to track down the problem more quickly if the message had been more informative, maybe like <code class="notranslate">ValueError: setting an irregularly shaped array with a non-object dtype</code> instead of <code class="notranslate">ValueError: setting an array element with a sequence.</code></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.array([[0, 1], [2]]).dtype
dtype('O')
&gt;&gt;&gt; np.array([[0, 1], [2]], dtype=int).dtype
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
ValueError: setting an array element with a sequence."><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; np.array([[0, 1], [2]]).dtype
dtype('O')
&gt;&gt;&gt; np.array([[0, 1], [2]], dtype=int).dtype
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
ValueError: setting an array element with a sequence.
</code></pre></div>