Signature Description Parameters
template<typename ... Ts>
void
self_shift(size_type periods, shift_policy sp);
It shifts all the columns in self up or down based on shift_policy. Values that are shifted will be assigned to NaN. The index column remains unchanged. If user shifts with periods that is larger than the column length, all values in that column become NaN. Ts: The list of types for all columns. A type should be specified only once.
periods: Number of periods to shift
shift_policy: Specifies the direction (i.e. up/down) to shift
template<typename ... Ts>
StdDataFrame<I>
shift(size_type periods, shift_policy sp);
It is exactly the same as self_shift, but it leaves self unchanged and returns a new DataFrame with columns shifted.