Data Standardization

New in version 0.1.

This function standardizes (z-score) the series according to equation

\(\textbf{x}_s = \frac{\textbf{x} - a}{b}\)

where \(\textbf{x}\) is time series to standardize, \(a\) is offset to remove and \(b\) scale to remove

See also: Data De-standardization

Usage Explanation

As simple as

xs = pa.standardize(x, offset=a , scale=b)

If the key arguments offset and scale are not provided (example below) the mean value and standard deviation of x is used.

xs = pa.standardize(x)

Minimal Working Example

An example how to standarize (z-score) data:

>>> import numpy as np
>>> import padasip as pa
>>> x = np.random.random(1000)
>>> x.mean()
>>> x.std()
>>> xs = pa.standardize(x)
>>> xs.mean()
>>> xs.std()

Code Explanation

padasip.preprocess.standardize.standardize(x, offset=None, scale=None)[source]

This is function for standarization of input series.


  • x : series (1 dimensional array)


  • offset : offset to remove (float). If not given, the mean value of x is used.
  • scale : scale (float). If not given, the standard deviation of x is used.


  • xs : standardized series