spectrochempy.normalize

normalize(dataset, method='max', dim='x', inplace=False)[source]

Normalize data along a dimension.

Parameters:
  • dataset (NDDataset) – The input data.

  • method (str, optional, default:’max’) – Normalization method:

    • 'max' β€” divide by the maximum absolute value.

    • 'sum' β€” divide by the sum of absolute values.

    • 'vector' β€” divide by the Euclidean (L2) norm.

    • 'minmax' β€” scale linearly to the range [0, 1].

  • dim (str or int, optional, default:’x’) – Dimension along which the normalization is computed.

  • inplace (bool, optional, default:False) – If True, the normalization is performed in place.

Returns:

NDDataset – The normalized dataset.

Examples

>>> dataset = scp.read("irdata/nh4.spg")
>>> nd = dataset.normalize(method="max", dim="x")