I'm trying to create a new pandas dataframe by rolling the row values in a window. i.e
A R N D C Q -1 -2 -3 -3 -1 -2 -1 -2 -3 -3 -1 -2 -1 -2 -3 -3 -1 -2 -1 -2 -3 -3 -1 -2 to something like this:
A1 R1 N1 D1 C1 Q1 A2 R2 N2 D2 C2 Q2 … An Rn Nn Dn Cn Qn -1 -2 -3 -3 -1 a -1 -2 -3 -3 -1 b -1 -2 -3 -3 -1 b -1 -2 -3 -3 -1 c -1 -2 -3 -3 -1 c -1 -2 -3 -3 -1 d -1 -2 -3 -3 -1 d . . . . . . it is similar to a rolling window in a string, i.e. EXAM with window 3 will yield EXA,XAM. The key difference here being that instead of letters, I'm trying to create windows by rows. This new dataframe will be used for training a svm. Although I can create another column with scaled value corresponding to other columns (a single column is easier to roll), I think I will loose some information, that's why I'm taking complete columns.
In essence, I'm trying to do something like this, but for n window size:
