I have a dataframe:

```
c1   Lag  Val1  
A    3    10
A    1    5
A    2    20
A    2    15
A    1    10
B    1    25
B    2    10

```

I want to create a new field val2 such that each value in val2 is the value in val2 shifted by Lag number of rows. The tricky part here is that the shift should happen within the groups defined in field c1, such that the output looks something like 

```
c1   Lag  Val1  Val2
A    3    10    15
A    1    5     20
A    2    20    10
A    2    15    NaN
A    1    10    NaN
B    1    25    10
B    2    10    NaN

```

I have been trying with along the lines of

```
df['Val2'] = df.groupby(['c1'])['Val1'].apply(lambda x:x.shift(df.Lag))

```

to no avail and getting a "The truth value of a Series is ambiguous." error. Appreciate any help. Thanks!