In [1]:
import pandas as pd
In [2]:
df = pd.DataFrame({'value': range(1, 16, 2)},
index=pd.date_range('2018-01-01', '2018-01-15', freq='2D'))
In [3]:
print(df)
In [4]:
print(df.diff())
In [5]:
print(df.diff(2))
In [6]:
print(df.shift(freq='2D'))
In [7]:
print(df - df.shift(freq='2D'))
In [8]:
print(df - df.shift(freq='D'))