Suppose I have the DataFrame (called `df`)

```
'name'    'order'    'quantity'
'A'       1           10
'A'       2           15
'A'       3           5
'B'       1           2
'B'       2           6

```

What I want is building another dataframe containing a column with the ratio of the differences of consecutive columns (consecutive in terms of column `order`) to the first value.

I am easily able to retrieve the difference in said ratio (the numerator) as

```
def compute_diff(x):

    quantity_diff = x.quantity.diff()

    return quantity_diff

diff_df = df.sort_values('order').groupby('name').apply(compute_diff).reset_index(name='diff')

```

This gives me

```
'name'    'level_1'    'quantity'
'A'       0           NaN
'A'       1           5
'A'       1           -10
'B'       1           NaN
'B'       2           4

```

Now I want the ratio instead, as per description. Specifically, I'd want

```
'name'    'level_1'    'quantity'
'A'       1           NaN
'A'       2           0.5
'A'       3           -0.6666
'B'       1           NaN
'B'       2           2

```

How to?