tried to set void-array with object members using buffer error message
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)])
--------------------------------------------------------------------------- TypeError Traceback (most recent call last)
/home/ctw/<ipython console> in <module>() TypeError: data type not understood
participants (2)
-
ctw
-
Robert Kern