<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 5, 2013 at 2:11 PM, Fernando Perez <span dir="ltr"><<a href="mailto:fperez.net@gmail.com" target="_blank">fperez.net@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi all,<br>
<br>
I just ran into this rather weird behavior:<br>
<br>
<a href="http://nbviewer.ipython.org/6453869" target="_blank">http://nbviewer.ipython.org/6453869</a><br>
<br>
In summary, as far as I can tell, shuffle is misbehaving when acting<br>
on arrays that have structured dtypes. I've seen the problem on 1.7.1<br>
(official on ubuntu 13.04) as well as master as of a few minutes ago.<br>
<br>
Is this my misuse? It really looks like a bug to me...<br>
<br></blockquote><div><br><br></div><div>Definitely a bug:<br><br><span style="font-family:courier new,monospace">In [1]: np.__version__<br>Out[1]: '1.9.0.dev-573b3b0'<br><br>In [2]: z = np.array([(0,),(1,),(2,),(3,),(4,)], dtype=[('a',int)])<br>
<br>In [3]: z<br>Out[3]: <br>array([(0,), (1,), (2,), (3,), (4,)], <br> dtype=[('a', '<i8')])<br><br>In [4]: shuffle(z)<br><br>In [5]: z<br>Out[5]: <br>array([(0,), (1,), (2,), (0,), (0,)], <br> dtype=[('a', '<i8')])</span><br>
<br><br><br></div><div>Nothing in the docstring suggests that it shouldn't work for structured dtypes.<br><br>Warren<br><br><br></div><div><br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Cheers,<br>
<br>
f<br>
<span class=""><font color="#888888"><br>
--<br>
Fernando Perez (@fperez_org; <a href="http://fperez.org" target="_blank">http://fperez.org</a>)<br>
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)<br>
fernando.perez-at-berkeley: contact me here for any direct mail<br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</font></span></blockquote></div><br></div></div>