im trying to apply np.roll with groupy of pandas.

Actually, i have this dataframe:
(In the columns complete\_contracts\_shift i applied shift with groupby:

```
df.groupby(['contracts ','param_contrct'])['complete_contracts '].shift(1)

```

| complete\_contracts | contracts | param\_contrct | complete\_contracts\_shift |
| --- | --- | --- | --- |
| F21-EZ-01/01/2022 | F21 | EZ | NaN |
| F21-EZ-02/01/2022 | F21 | EZ | F21-EZ-01/01/2022 |
| F21-EZ-03/01/2022 | F21 | EZ | F21-EZ-02/01/2022 |
| F21-AB-01/01/2022 | F21 | AB | NaN |
| F21-AB-02/01/2022 | F21 | AB | F21-AB-01/01/2022 |
| F21-AB-03/01/2022 | F21 | AB | F21-AB-02/01/2022 |

I need that dataframe has the column 'complete\_contracts\_shift' as follows:

| complete\_contracts | contracts | param\_contrct | complete\_contracts\_shift |
| --- | --- | --- | --- |
| F21-EZ-01/01/2022 | F21 | EZ | F21-EZ-03/01/2022 |
| F21-EZ-02/01/2022 | F21 | EZ | F21-EZ-01/01/2022 |
| F21-EZ-03/01/2022 | F21 | EZ | F21-EZ-02/01/2022 |
| F21-AB-01/01/2022 | F21 | AB | F21-AB-03/01/2022 |
| F21-AB-02/01/2022 | F21 | AB | F21-AB-01/01/2022 |
| F21-AB-03/01/2022 | F21 | AB | F21-AB-02/01/2022 |

i know np.roll of numpy, but i cant combinate this with groupby.