Hi! Can someone here shed some light on this behavior:

> tst = np.zeros(2,[('a',np.int32),('b','S04')])
> np.random.shuffle(tst) # this works fine

> tst2 = np.zeros(2,[('a',np.int32),('b',list)])
> np.random.shuffle(tst2)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/home/ctw/<ipython console> in <module>()

/home/ctw/mtrand.pyx in mtrand.RandomState.shuffle()

ValueError: tried to set void-array with object members using buffer.





I get the same error if I use np.ndarray instead of list. Also, when I
put in a class I locally define I get a "data type not understood"
error:

> class tstcls:
>    pass

> tst4 = np.zeros(2,[('a',np.int32),('b',tstcls)])
<class __main__.tstcls at
0x944a7dc>---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/ctw/<ipython console> in <module>()

TypeError: data type not understood
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to