import dascore as dc
= dc.get_example_patch()
patch
# standardize along the time axis
= patch.standardize('time')
standardized_time
# standardize along the x axis
= patch.standardize('distance') standardized_distance
standardize
standardize(
self: Patch ,
dim: str ,
)-> ‘PatchType’
Standardize data by removing the mean and scaling to unit variance.
The standard score of a sample x is calculated as:
z = (x - u) / s where u is the mean of the training samples or zero if with_mean=False, and s is the standard deviation of the training samples or one if with_std=False.
Parameters
Parameter | Description |
---|---|
dim | The dimension along which the normalization takes place. |
Examples
```