spectrochempy.full
- full(shape, fill_value=0.0, dtype=None, **kwargs)[source]
Return a new
NDDatasetof 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_likeReturn an array of zeros with shape and type of input.
ones_likeReturn an array of ones with shape and type of input.
empty_likeReturn an empty array with shape and type of input.
full_likeFill an array with shape and type of input.
zerosReturn a new array setting values to zero.
onesReturn a new array setting values to one.
emptyReturn 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))