say that I have the following two masked arrays declarations:
arr1 = ma.array([(1,2,"hello"),(10,20,"world!")],dtype=[("p1",int),("p2",float),("p3",object)])
arr1.mask["p1"][0] = True
arr1.mask["p2"][1] = True
arr2 = ma.array([(1,2,3),(10,20,30)],dtype=[("p1",int),("p2",float),("p3",int)])
arr2.mask["p1"][0] = True
arr2.mask["p2"][1] = True
as you can see the only (slight ?) difference is that the "p3" field is an object for arr1
and an int for arr2
.
Calling arr2[0]
is OK and gives (--, 2.0, 3)
.
However, when masking some elements of arr1
, calling arr1[0]
gives the following error:
*** ValueError: Setting void-array with object members using buffer.
Clearly, declaring one field as an object triggered some troubles but I have no single idea why.
What do you think about this and would you see some ways to circumvent that problem, keeping in mind that I would really need to access 'arr1[0]' on that way ?
thanks a lot
Eric
EDIT: this problem occurs with numpy version < 1.8. I tried with the latest version (1.8) and it is OK.