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:
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:

pint.Quantity or numpy.ndarray or numpy.ma.MaskedArray

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.