1/19/2022

pandas pct_change(), function to find the percentage change in the time-series data.

 The rate of change between the previous data and the current data

.

import pandas as pd
data=[100, 200, 100, 100, 200, 100]
df = pd.DataFrame(data)
df.pct_change()

.

     0
0 NaN
1 1.0
2 -0.5
3 0.0
4 1.0
5 -0.5


www.marearts.com
๐Ÿ™‡๐Ÿป‍♂️

No comments:

Post a Comment