finam.data.from_compressed#
- finam.data.from_compressed(xdata, shape, order='C', **kwargs)[source]#
Fill a (masked) array following a given mask or shape with the provided data.
This will only create a masked array if kwargs are given (especially a mask). Otherwise this is simply reshaping the given data. Filling is performed in the given array order.
- Parameters:
data (
pint.Quantity
ornumpy.ndarray
ornumpy.ma.MaskedArray
) – The reference object input.shape (str) – shape argument for
numpy.reshape
order (str) – order argument for
numpy.reshape
**kwargs – keyword arguments forwarded to
numpy.ma.array
- Returns:
New object with the desired shape and same type as input. Units will be taken from the input if present. Will only be a masked array if kwargs are given.
- Return type:
See also
to_compressed
Inverse operation.
numpy.ma.array
Routine consuming kwargs to create a masked array.
numpy.reshape
Equivalent routine if no mask is provided.
Notes
If both mask and shape are given, they need to match in size.