O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Calculating normalized z-scores with a transformation

Another common example of transformation is creating normalized z-scores on groups of data. To demonstrate this, we will take a randomly generated series of values using a normal distribution with mean of 0.5 and a standard deviation of 2. The data is indexed by day and a rolling mean is calculated on a 100-day window to generate samples of the mean:

The rolling means have the following appearance:

At this point, we would like to standardize the rolling means for each calendar year. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required