[Numpy-discussion] Question about recarray

Travis Oliphant oliphant.travis at ieee.org
Thu Sep 21 12:43:44 EDT 2006


Lionel Roubeyrie wrote:
> Hi all,
> Is it possible to put masked values into recarrays, I need a array with 
> heterogenous types of datas (datetime objects in the first col, all others 
> are float) but with missing values in some records. For the moment, I don't 
> find any solution for that. 
Either use "nans" or "inf" for missing values or use the masked array 
object with a complex data-type.   You don't need to use a recarray 
object to get "records".  Any array can have "records".  Therefore, you 
can have a masked array of "records" by creating an array with the 
appropriate data-type.  

It may also be possible to use a recarray as the "array" for the masked 
array object becuase the recarray is a sub-class of the array.

> I have tried with arrays of dtype=object, but I 
> have problem when I want to compute min, max, ... with an error like:
> TypeError: function not supported for these types, and can't coerce safely to 
> supported types.
>   
It looks like the max and min functions are not supported for Object 
arrays.

import numpy as N
N.maximum.types

does not include Object arrays. 

It probably should.

-Travis





More information about the NumPy-Discussion mailing list