title: Trying to create a new dataframe from row of source dataframe with conditional transpose
body: <p>I have a dataframe similar to provided below:</p>
  <pre><code>time   count1   count2  result
  t1      c11       c21     r1
  t2      c12       c22     r2
  t3      c13       c23     r3
  t4      c14       c24     r4
  t5      c15       c25     r5
  t6      c16       c26     r6
  </code></pre>
  <p>I want to prepare a dataframe that would look like this:</p>
  <pre><code>df1    
  count1-1   count1-2  count1-3  count2-1  count2-2  count2-3  result 
      c11       c12      c13        c21       c22       c23      r4       
      c14       c15      c16        c24       c25       c26      r5      
  </code></pre>
  <p>Please note that result column has a shift of +1. so counts taken are 3 rows and the corresponding result is the next row which is 4th row.</p>
  <p>I have a code that takes in the difference between values but I do not want to take the difference. my code looks like below. I know there is a minor change however I am confused how to change the logic.</p>
  <pre><code>df1 = pd.concat([-df['count1'].diff(periods=-i) for i in range(1, lag + 1)], axis=1).dropna(axis=0)
  df2 = pd.concat([-df['count2'].diff(periods=-i) for i in range(1, lag + 1)], axis=1).dropna(axis=0)
  cdf = pd.concat([df1,df2], axis=1)
  
  target_df = df.copy(deep=True)
  target_df = df.iloc[:len(df1)]
  target_df = target_df.drop(columns=['count1', 'count2'])
  </code></pre>