Examples
import numpy as np
import pandas as pd
df = pd.DataFrame({
'AU': [6.0505, 6.0963, 6.3549],
'IT': [5.7446, 5.7482, 5.8919],
'DK': [904.76, 910.02, 960.14]},
index=['1999-01-01', '1999-02-01', '1999-03-01'])
df
df.pct_change()
Percentage of change in GOOG and APPL stock volume. Shows computing the percentage
change between columns:
df = pd.DataFrame({
'2006': [1869950, 32586265],
'2005': [1600923, 44912316],
'2004': [1271819, 45403351]},
index=['GOOG', 'APPL'])
df
df.pct_change(axis='columns')