Run ❯
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
import pandas as pd data = [[10, 18, 11], [20, 15, 8], [30, 20, 3]] df = pd.DataFrame(data) print(df.pct_change())
0 1 2 0 NaN NaN NaN 1 1.0 -0.166667 -0.272727 2 0.5 0.333333 -0.625000