<p dir="auto">numpy.unique returns erroneous results when the number 63 is encountered in masked uint8 array with return_index=True:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; src_ds = '/Users/histo/S2_10_T_DN_2016_7_27_0_4328_repro.tif'
&gt;&gt;&gt; src_ds = gdal.Open(src_ds)
&gt;&gt;&gt; src = src_ds.GetRasterBand(1).ReadAsArray()
&gt;&gt;&gt; src = np.ma.masked_equal(src, 0)
&gt;&gt;&gt; src = src.ravel()
&gt;&gt;&gt; s_values, s_idx, s_counts = np.unique(src, return_index=True, return_inverse=True)
&gt;&gt;&gt; s_values
masked_array(data = [3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
 55 56 57 58 59 60 61 62 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63
 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 --
 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63
 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 --
 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63 -- 63
 -- 63 -- 63 -- 63 -- 63 -- `"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">src_ds</span> <span class="pl-c1">=</span> <span class="pl-s">'/Users/histo/S2_10_T_DN_2016_7_27_0_4328_repro.tif'</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">src_ds</span> <span class="pl-c1">=</span> <span class="pl-s1">gdal</span>.<span class="pl-v">Open</span>(<span class="pl-s1">src_ds</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">src</span> <span class="pl-c1">=</span> <span class="pl-s1">src_ds</span>.<span class="pl-v">GetRasterBand</span>(<span class="pl-c1">1</span>).<span class="pl-v">ReadAsArray</span>()
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">src</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">ma</span>.<span class="pl-en">masked_equal</span>(<span class="pl-s1">src</span>, <span class="pl-c1">0</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">src</span> <span class="pl-c1">=</span> <span class="pl-s1">src</span>.<span class="pl-en">ravel</span>()
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">s_values</span>, <span class="pl-s1">s_idx</span>, <span class="pl-s1">s_counts</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">unique</span>(<span class="pl-s1">src</span>, <span class="pl-s1">return_index</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, <span class="pl-s1">return_inverse</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">s_values</span>
<span class="pl-s1">masked_array</span>(<span class="pl-s1">data</span> <span class="pl-c1">=</span> [<span class="pl-c1">3</span> <span class="pl-c1">4</span> <span class="pl-c1">5</span> <span class="pl-c1">6</span> <span class="pl-c1">7</span> <span class="pl-c1">8</span> <span class="pl-c1">9</span> <span class="pl-c1">10</span> <span class="pl-c1">11</span> <span class="pl-c1">12</span> <span class="pl-c1">13</span> <span class="pl-c1">14</span> <span class="pl-c1">15</span> <span class="pl-c1">16</span> <span class="pl-c1">17</span> <span class="pl-c1">18</span> <span class="pl-c1">19</span> <span class="pl-c1">20</span> <span class="pl-c1">21</span> <span class="pl-c1">22</span> <span class="pl-c1">23</span> <span class="pl-c1">24</span> <span class="pl-c1">25</span> <span class="pl-c1">26</span> <span class="pl-c1">27</span> <span class="pl-c1">28</span> <span class="pl-c1">29</span>
 <span class="pl-c1">30</span> <span class="pl-c1">31</span> <span class="pl-c1">32</span> <span class="pl-c1">33</span> <span class="pl-c1">34</span> <span class="pl-c1">35</span> <span class="pl-c1">36</span> <span class="pl-c1">37</span> <span class="pl-c1">38</span> <span class="pl-c1">39</span> <span class="pl-c1">40</span> <span class="pl-c1">41</span> <span class="pl-c1">42</span> <span class="pl-c1">43</span> <span class="pl-c1">44</span> <span class="pl-c1">45</span> <span class="pl-c1">46</span> <span class="pl-c1">47</span> <span class="pl-c1">48</span> <span class="pl-c1">49</span> <span class="pl-c1">50</span> <span class="pl-c1">51</span> <span class="pl-c1">52</span> <span class="pl-c1">53</span> <span class="pl-c1">54</span>
 <span class="pl-c1">55</span> <span class="pl-c1">56</span> <span class="pl-c1">57</span> <span class="pl-c1">58</span> <span class="pl-c1">59</span> <span class="pl-c1">60</span> <span class="pl-c1">61</span> <span class="pl-c1">62</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span>
 <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span>
 <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span>
 <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span>
 <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span>
 <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> <span class="pl-c1">63</span> <span class="pl-c1">-</span><span class="pl-c1">-</span> `</pre></div>
<p dir="auto">This is reproducible:</p>
<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([64, 0, 1, 2, 3, 62, 62, 0, 0, 0, 1, 2, 0, 62, 0], dtype='uint8')
y = np.ma.masked_equal(x, 0)
v, i, c = np.unique(y, return_index=True, return_counts=True)
print(v)
# [1 2 3 62 -- 64]"><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">64</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>, <span class="pl-c1">62</span>, <span class="pl-c1">62</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">0</span>, <span class="pl-c1">62</span>, <span class="pl-c1">0</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'uint8'</span>)
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">ma</span>.<span class="pl-en">masked_equal</span>(<span class="pl-s1">x</span>, <span class="pl-c1">0</span>)
<span class="pl-s1">v</span>, <span class="pl-s1">i</span>, <span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">unique</span>(<span class="pl-s1">y</span>, <span class="pl-s1">return_index</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, <span class="pl-s1">return_counts</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-en">print</span>(<span class="pl-s1">v</span>)
<span class="pl-c"># [1 2 3 62 -- 64]</span></pre></div>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="x = np.array([64, 0, 1, 2, 3, 63, 63, 0, 0, 0, 1, 2, 0, 63, 0], dtype='uint8')
y = np.ma.masked_equal(x, 0)
v, i, c = np.unique(y, return_index=True, return_counts=True)
print(v)
# [1 2 3 -- 63 -- 63 -- 64]"><pre class="notranslate"><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">64</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>, <span class="pl-c1">63</span>, <span class="pl-c1">63</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">0</span>, <span class="pl-c1">63</span>, <span class="pl-c1">0</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'uint8'</span>)
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">ma</span>.<span class="pl-en">masked_equal</span>(<span class="pl-s1">x</span>, <span class="pl-c1">0</span>)
<span class="pl-s1">v</span>, <span class="pl-s1">i</span>, <span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">unique</span>(<span class="pl-s1">y</span>, <span class="pl-s1">return_index</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, <span class="pl-s1">return_counts</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-en">print</span>(<span class="pl-s1">v</span>)
<span class="pl-c"># [1 2 3 -- 63 -- 63 -- 64]</span></pre></div>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="x = np.array([64, 0, 1, 2, 3, 63, 63, 0, 0, 0, 1, 2, 0, 63, 0], dtype='uint8')
y = np.ma.masked_equal(x, 0)
v = np.unique(y)
print(v)
# [1 2 3 63 64 --]"><pre class="notranslate"><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">64</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>, <span class="pl-c1">63</span>, <span class="pl-c1">63</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">0</span>, <span class="pl-c1">63</span>, <span class="pl-c1">0</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'uint8'</span>)
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">ma</span>.<span class="pl-en">masked_equal</span>(<span class="pl-s1">x</span>, <span class="pl-c1">0</span>)
<span class="pl-s1">v</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">unique</span>(<span class="pl-s1">y</span>)
<span class="pl-en">print</span>(<span class="pl-s1">v</span>)
<span class="pl-c"># [1 2 3 63 64 --]</span></pre></div>
<p dir="auto">A workaround has been suggested <a href="http://stackoverflow.com/questions/42360616/unexpected-numpy-unique-behavior" rel="nofollow">on stackoverflow</a> by changing the dtype to int16:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="x = np.array([64, 0, 1, 2, 3, 63, 63, 0, 0, 0, 1, 2, 0, 63, 0], dtype='uint8')
y = np.ma.masked_equal(x.astype('int16'), 0)
v, i, c = np.unique(y, return_index=True, return_counts=True)
print(v)
# [1 2 3 63 64 --]"><pre class="notranslate"><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">64</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>, <span class="pl-c1">63</span>, <span class="pl-c1">63</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">0</span>, <span class="pl-c1">63</span>, <span class="pl-c1">0</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'uint8'</span>)
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">ma</span>.<span class="pl-en">masked_equal</span>(<span class="pl-s1">x</span>.<span class="pl-en">astype</span>(<span class="pl-s">'int16'</span>), <span class="pl-c1">0</span>)
<span class="pl-s1">v</span>, <span class="pl-s1">i</span>, <span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">unique</span>(<span class="pl-s1">y</span>, <span class="pl-s1">return_index</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, <span class="pl-s1">return_counts</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-en">print</span>(<span class="pl-s1">v</span>)
<span class="pl-c"># [1 2 3 63 64 --]</span></pre></div>
<p dir="auto">This works but greatly increases the memory footprint which is undesirable.</p>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1254" rel="nofollow">http://projects.scipy.org/numpy/ticket/1254</a> on 2009-10-07 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mdboom/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mdboom">@mdboom</a>, assigned to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/teoliphant/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/teoliphant">@teoliphant</a>.</em></p>
<p dir="auto">Creating a newbyteorder of a dtype which contains both a name and title returns the "" dtype.  Using this dtype to create a new array segfaults.</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; x = np.array([(1, 1)], dtype=[(('a', 'a'), 'i'), ('b', 'i')])
   &gt;&gt;&gt; x.dtype.newbyteorder('&gt;')
   dtype(&lt;err&gt;)
   &gt;&gt;&gt; y = np.array(x, dtype=x.dtype.newbyteorder('&gt;'))
   Segmentation fault"><pre class="notranslate"><code class="notranslate">   &gt;&gt;&gt; import numpy as np
   &gt;&gt;&gt; x = np.array([(1, 1)], dtype=[(('a', 'a'), 'i'), ('b', 'i')])
   &gt;&gt;&gt; x.dtype.newbyteorder('&gt;')
   dtype(&lt;err&gt;)
   &gt;&gt;&gt; y = np.array(x, dtype=x.dtype.newbyteorder('&gt;'))
   Segmentation fault
</code></pre></div>
<p dir="auto">And here's the backtrace from the segfault</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[Switching to Thread -1208456544 (LWP 6456)]
0x080d5957 in vgetargs1 (args=0x0, format=0xb7db54 &quot;&quot;,  p_va=0xbfe05bd4, flags=Variable &quot;flags&quot; is not available.
)
    at Python/getargs.c:286
286             if (!PyTuple_Check(args)) {
(gdb) bt
#0  0x080d5957 in vgetargs1 (args=0x0, format=0xb7db54 &quot;&quot;, p_va=0xbfe05bd4,
    flags=Variable &quot;flags&quot; is not available.
) at Python/getargs.c:286
#1  0x080d5ec5 in _PyArg_ParseTuple_SizeT (args=0xb7db55, format=0xb7db54 &quot;&quot;)
    at Python/getargs.c:96
#2  0x00b73092 in VOID_setitem (op=0xb7a9090c, ip=0x8fc8980 &quot;&quot;, ap=0x8fa80e8)
    at numpy/core/src/multiarray/arraytypes.c.src:620
#3  0x00b748ce in VOID_to_VOID (ip=0x8fd4838 &quot;\001&quot;, op=0x8fc8980 &quot;&quot;, n=1,
    aip=0x8ebacd8, aop=0x8fa80e8)
    at numpy/core/src/multiarray/arraytypes.c.src:1392
#4  0x00b53958 in PyArray_CastTo (out=0x8fa80e8, mp=0x8ebacd8)
    at numpy/core/src/multiarray/convert_datatype.c:316
#5  0x00b4ae74 in _array_copy_into (dest=0x8fa80e8, src=0x8ebacd8, usecopy=1)
    at numpy/core/src/multiarray/ctors.c:855
#6  0x00b4be98 in PyArray_FromArray (arr=0x8ebacd8, newtype=0xb7a982f0,
    flags=112) at numpy/core/src/multiarray/ctors.c:2421
#7  0x00b4c3ef in PyArray_FromAny (op=0x8ebacd8, newtype=0xb7a982f0,
    min_depth=0, max_depth=0, flags=112, context=0x0)
    at numpy/core/src/multiarray/ctors.c:1598
#8  0x00b6a60a in PyArray_CheckFromAny (op=0x8ebacd8, descr=0xb7a982f0,
    min_depth=0, max_depth=0, requires=112, context=0x0)
    at numpy/core/src/multiarray/ctors.c:1769
#9  0x00b75fde in _array_fromobject (__NPY_UNUSED_TAGGEDignored=0x0,
    args=0xb7f0a2cc, kws=0xb7a91dfc)
    at numpy/core/src/multiarray/multiarraymodule.c:1478
#10 0x0805d984 in PyObject_Call (func=0xb7db50, arg=0xb7f0a2cc, kw=0xb7a91dfc)
    at Objects/abstract.c:1861
#11 0x080bf804 in PyEval_EvalFrameEx (f=0x8e85dc4, throwflag=0)
    at Python/ceval.c:3784
#12 0x080c43bb in PyEval_EvalCodeEx (co=0xb7eabec0, globals=0xb7f5eacc,
    locals=0xb7f5eacc, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
    defcount=0, closure=0x0) at Python/ceval.c:2836
#13 0x080c450a in PyEval_EvalCode (co=0xb7eabec0, globals=0xb7f5eacc,
    locals=0xb7f5eacc) at Python/ceval.c:494
#14 0x080e3e52 in PyRun_InteractiveOneFlags (fp=0xd16720,
    filename=0x811a058 &quot;&lt;stdin&gt;&quot;, flags=0xbfe065dc) at Python/pythonrun.c:1273
#15 0x080e4005 in PyRun_InteractiveLoopFlags (fp=0xd16720,
    filename=0x811a058 &quot;&lt;stdin&gt;&quot;, flags=0xbfe065dc) at Python/pythonrun.c:723
#16 0x080e4525 in PyRun_AnyFileExFlags (fp=0xd16720,
    filename=0x811a058 &quot;&lt;stdin&gt;&quot;, closeit=0, flags=0xbfe065dc)
    at Python/pythonrun.c:692
#17 0x08056d85 in Py_Main (argc=0, argv=0xbfe06714) at Modules/main.c:523
#18 0x08056323 in main (argc=1, argv=0xbfe06714) at ./Modules/python.c:23"><pre class="notranslate"><code class="notranslate">[Switching to Thread -1208456544 (LWP 6456)]
0x080d5957 in vgetargs1 (args=0x0, format=0xb7db54 "",  p_va=0xbfe05bd4, flags=Variable "flags" is not available.
)
    at Python/getargs.c:286
286             if (!PyTuple_Check(args)) {
(gdb) bt
#0  0x080d5957 in vgetargs1 (args=0x0, format=0xb7db54 "", p_va=0xbfe05bd4,
    flags=Variable "flags" is not available.
) at Python/getargs.c:286
#1  0x080d5ec5 in _PyArg_ParseTuple_SizeT (args=0xb7db55, format=0xb7db54 "")
    at Python/getargs.c:96
#2  0x00b73092 in VOID_setitem (op=0xb7a9090c, ip=0x8fc8980 "", ap=0x8fa80e8)
    at numpy/core/src/multiarray/arraytypes.c.src:620
#3  0x00b748ce in VOID_to_VOID (ip=0x8fd4838 "\001", op=0x8fc8980 "", n=1,
    aip=0x8ebacd8, aop=0x8fa80e8)
    at numpy/core/src/multiarray/arraytypes.c.src:1392
#4  0x00b53958 in PyArray_CastTo (out=0x8fa80e8, mp=0x8ebacd8)
    at numpy/core/src/multiarray/convert_datatype.c:316
#5  0x00b4ae74 in _array_copy_into (dest=0x8fa80e8, src=0x8ebacd8, usecopy=1)
    at numpy/core/src/multiarray/ctors.c:855
#6  0x00b4be98 in PyArray_FromArray (arr=0x8ebacd8, newtype=0xb7a982f0,
    flags=112) at numpy/core/src/multiarray/ctors.c:2421
#7  0x00b4c3ef in PyArray_FromAny (op=0x8ebacd8, newtype=0xb7a982f0,
    min_depth=0, max_depth=0, flags=112, context=0x0)
    at numpy/core/src/multiarray/ctors.c:1598
#8  0x00b6a60a in PyArray_CheckFromAny (op=0x8ebacd8, descr=0xb7a982f0,
    min_depth=0, max_depth=0, requires=112, context=0x0)
    at numpy/core/src/multiarray/ctors.c:1769
#9  0x00b75fde in _array_fromobject (__NPY_UNUSED_TAGGEDignored=0x0,
    args=0xb7f0a2cc, kws=0xb7a91dfc)
    at numpy/core/src/multiarray/multiarraymodule.c:1478
#10 0x0805d984 in PyObject_Call (func=0xb7db50, arg=0xb7f0a2cc, kw=0xb7a91dfc)
    at Objects/abstract.c:1861
#11 0x080bf804 in PyEval_EvalFrameEx (f=0x8e85dc4, throwflag=0)
    at Python/ceval.c:3784
#12 0x080c43bb in PyEval_EvalCodeEx (co=0xb7eabec0, globals=0xb7f5eacc,
    locals=0xb7f5eacc, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
    defcount=0, closure=0x0) at Python/ceval.c:2836
#13 0x080c450a in PyEval_EvalCode (co=0xb7eabec0, globals=0xb7f5eacc,
    locals=0xb7f5eacc) at Python/ceval.c:494
#14 0x080e3e52 in PyRun_InteractiveOneFlags (fp=0xd16720,
    filename=0x811a058 "&lt;stdin&gt;", flags=0xbfe065dc) at Python/pythonrun.c:1273
#15 0x080e4005 in PyRun_InteractiveLoopFlags (fp=0xd16720,
    filename=0x811a058 "&lt;stdin&gt;", flags=0xbfe065dc) at Python/pythonrun.c:723
#16 0x080e4525 in PyRun_AnyFileExFlags (fp=0xd16720,
    filename=0x811a058 "&lt;stdin&gt;", closeit=0, flags=0xbfe065dc)
    at Python/pythonrun.c:692
#17 0x08056d85 in Py_Main (argc=0, argv=0xbfe06714) at Modules/main.c:523
#18 0x08056323 in main (argc=1, argv=0xbfe06714) at ./Modules/python.c:23
</code></pre></div>