spectrochempy.full
- full(shape, fill_value=0.0, dtype=None, **kwargs)[source]
Return a new
NDDataset
of given shape and type, filled withfill_value
.- Parameters:
shape (int or sequence of ints) – Shape of the new array, e.g.,
(2, 3)
or2
.fill_value (scalar) – Fill value.
dtype (data-type, optional) – The desired data-type for the array, e.g.,
np.int8
. Default is fill_value.dtype.**kwargs – Optional keyword parameters (see Other Parameters).
- Returns:
full – Array of
fill_value
.- Other Parameters:
units (str or ur instance) – Units of the returned object. If not provided, try to copy from the input object.
coordset (list or Coordset object) – Coordinates for the returned object. If not provided, try to copy from the input object.
See also
zeros_like
Return an array of zeros with shape and type of input.
ones_like
Return an array of ones with shape and type of input.
empty_like
Return an empty array with shape and type of input.
full_like
Fill an array with shape and type of input.
zeros
Return a new array setting values to zero.
ones
Return a new array setting values to one.
empty
Return a new uninitialized array.
Examples
>>> scp.full((2, ), np.inf) NDDataset: [float64] unitless (size: 2) >>> scp.NDDataset.full((2, 2), 10, dtype=np.int) NDDataset: [int64] unitless (shape: (y:2, x:2))