, fill_value=None)[source]#

Return input as an array with masked data replaced by a fill value.

This routine respects quantified and un-quantified data.

  • data (pint.Quantity or numpy.ndarray or – The reference object input.

  • fill_value (array_like, optional) – The value to use for invalid entries. Can be scalar or non-scalar. If non-scalar, the resulting ndarray must be broadcastable over input array. Default is None, in which case, the fill_value attribute of the array is used instead.


New object with the same shape and type as other, with the data filled with fill_value. Units will be taken from the input if present.

Return type:

pint.Quantity or numpy.ndarray

See also

Numpy routine doing the same.