spectrochempy.abs

abs(dataset, dtype=None)[source]

Calculate the absolute value of the given NDDataset element-wise.

abs is a shorthand for this function. For complex input, a + ib, the absolute value is \(\sqrt{ a^2 + b^2}\).

Parameters
  • dataset (array_like) – Input array or object that can be converted to an array.

  • dtype (dtype) – The type of the output array. If dtype is not given, infer the data type from the other input arguments.

Returns

absolute – An ndarray containing the absolute value of each element in dataset.