Masked Arrays numpyma

These are adapted from the masked arrays provided with Numeric. Masked Arrays do not inherit from the ndarray, they simply use two ndarray objects in their internal representation. Fortunately, as I have not used masked arrays in my work, Paul

Dubois (the original author of MA for Numeric) adapted and modified the code for use by NumPy. Alexander Belopolsky (Sasha) added additional functions and improvements

Masked arrays are created using the masked array creation function.

ma.array (data, dtype=None, copy=True, order='C', mask=ma.nomask, fill_value=None)

data Something that can be converted to an array. If data is already a masked array, then if mask is ma.nomask, the mask used be data.mask and the data used data.data.

dtype The data-type of the underlying array copy If copy is False, then every effort will be made to not copy the data.

order Specify whether the array is in 'C', 'Fortran', or 'Any' order mask Masked values are excluded from calculations. If this is ma.nomask, then there are no masked values. Otherwise, this should be an object that is convertible to an array of Booleans with the same shape as data.

fill_value This value is used to fill in masked values when necessary. The fill-value is not used for computation for functions within the ma module.

Masked arrays have the same methods and attributes as arrays with the addition of the mask attribute as well as the "hidden" attributes .-data and ._mask.

0 0

Post a comment