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 (
strorint, optional, default:’x’) – Dimension along which the normalization is computed.inplace (
bool, optional, default:False) – IfTrue, 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")