title: pandas: creating lagged variables of existing variable in a loop
body: <p>I have a dataframe df with multiple time series variables. Say variable 'A', 'B', 'C' etc.</p>
  
  <p>There have date as the index. How can I create 3,6 and 12 month lagged version in  a loop? I guess I could manually type for each variable like below, but was hoping if there is an efficient way to do it. Thanks.</p>
  
  <pre><code>df['A_3'] = df['A'].shift(3)
  df['A_6'] = df['A'].shift(6)
  df['A_12'] = df['A'].shift(12)
  
  df['B_3'] = df['B'].shift(3)
  df['B_6'] = df['B'].shift(6)
  df['B_12'] = df['B'].shift(12)
  </code></pre>