useful vectorization methods for pandas.DataFrame
.diff
Calculates the difference of a DataFrame element compared with another element in the DataFrame (default is element in previous row).
pd.DataFrame.diff(periods=1, axis=0)
.rolling
Provide rolling window calculations.
window
and min_periods
are common tunning parameters
DataFrame.rolling(window, min_periods=None, center=False, win_type=None, on=None, axis=0, closed=None, step=None, method='single')
.cumsum
Return cumulative sum over a DataFrame or Series axis.
Returns a DataFrame or Series of the same size containing the cumulative sum.
DataFrame.cumsum(axis=None, skipna=True, *args, **kwargs