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")