spectrochempy.log_transformο
- log_transform(dataset, method='log1p', eps=1e-10, inplace=False)[source]ο
Apply a logarithmic transform.
- Parameters
dataset (
NDDataset) β The input data.method (
str, optional, default:βlog1pβ) β Transform to apply:'log1p'β computelog(1 + x)(stable for small or zero values).'log'β computelog(x). If the data contain values \(\le 0\), a small offsetepsis added automatically.
eps (
float, optional, default:1e-10) β Offset added whenmethod='log'and non-positive values are present.inplace (
bool, optional, default:False) β IfTrue, the transform is performed in place.
- Returns
NDDatasetβ The log-transformed dataset.
Examples
>>> dataset = scp.read("irdata/nh4y-activation.spg") >>> nd = dataset.log_transform(method="log1p")