<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1736" rel="nofollow">http://projects.scipy.org/numpy/ticket/1736</a> on 2011-02-04 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/FrancescAlted/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/FrancescAlted">@FrancescAlted</a>, assigned to unknown.</em></p>
<p dir="auto">The next script describes the problem.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np

print &quot;numpy version:&quot;, np.__version__

a = np.zeros((), dtype=&quot;S10&quot;)
a[()] = &quot;hello1&quot;  # works!
print a
a[()] = np.array(&quot;hello2&quot;)  # fails on 1.6.0.dev
print a"><pre class="notranslate"><code class="notranslate">import numpy as np

print "numpy version:", np.__version__

a = np.zeros((), dtype="S10")
a[()] = "hello1"  # works!
print a
a[()] = np.array("hello2")  # fails on 1.6.0.dev
print a
</code></pre></div>
<p dir="auto">Running it with 1.5.0:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="numpy version: 1.5.0.dev7987
hello1
hello2"><pre class="notranslate"><code class="notranslate">numpy version: 1.5.0.dev7987
hello1
hello2
</code></pre></div>
<p dir="auto">With 1.6.0.dev:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="numpy version: 1.6.0.dev-0e60ecb
hello1
Traceback (most recent call last):
  File &quot;/tmp/scalar-string-bug.py&quot;, line 8, in &lt;module&gt;
    a[()] = np.array(&quot;hello2&quot;)
ValueError: cannot set an array element with a sequence"><pre class="notranslate"><code class="notranslate">numpy version: 1.6.0.dev-0e60ecb
hello1
Traceback (most recent call last):
  File "/tmp/scalar-string-bug.py", line 8, in &lt;module&gt;
    a[()] = np.array("hello2")
ValueError: cannot set an array element with a sequence
</code></pre></div>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1735" rel="nofollow">http://projects.scipy.org/numpy/ticket/1735</a> on 2011-02-04 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/FrancescAlted/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/FrancescAlted">@FrancescAlted</a>, assigned to unknown.</em></p>
<p dir="auto">The next script describes the problem.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np

print &quot;numpy version:&quot;, np.__version__

a = np.zeros((), dtype=&quot;S10&quot;)
a[()] = &quot;hello1&quot;  # works!
print a
a[()] = np.array(&quot;hello2&quot;)  # fails on 1.6.0.dev
print a"><pre class="notranslate"><code class="notranslate">import numpy as np

print "numpy version:", np.__version__

a = np.zeros((), dtype="S10")
a[()] = "hello1"  # works!
print a
a[()] = np.array("hello2")  # fails on 1.6.0.dev
print a
</code></pre></div>
<p dir="auto">Running it with 1.5.0:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="numpy version: 1.5.0.dev7987
hello1
hello2"><pre class="notranslate"><code class="notranslate">numpy version: 1.5.0.dev7987
hello1
hello2
</code></pre></div>
<p dir="auto">With 1.6.0.dev:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="numpy version: 1.6.0.dev-0e60ecb
hello1
Traceback (most recent call last):
  File &quot;/tmp/scalar-string-bug.py&quot;, line 8, in &lt;module&gt;
    a[()] = np.array(&quot;hello2&quot;)
ValueError: cannot set an array element with a sequence"><pre class="notranslate"><code class="notranslate">numpy version: 1.6.0.dev-0e60ecb
hello1
Traceback (most recent call last):
  File "/tmp/scalar-string-bug.py", line 8, in &lt;module&gt;
    a[()] = np.array("hello2")
ValueError: cannot set an array element with a sequence
</code></pre></div>