I have been stuck to a problem where I have done all the groupby operation and got the resultant dataframe as shown below but the problem came in last operation of calculation of one additional column

Current dataframe:

```
code        industry               category     count     duration
2       Retail                      Mobile        4         7
3       Retail                      Tab           2         33
3       Health                      Mobile        5         103
2       Food                         TV           1         88

```

The question: Want an additional column `operation` which calculates the ratio of count of industry 'retail' for the specific `code` column entry

for example: code `2` has 2 `industry` entry retail and food so `operation` column should have value `4/(4+1) = 0.8` and similarly for code`3` as well as shown below

O/P:

```
code        industry               category     count     duration  operation
2       Retail                      Mobile        4         7         0.8
3       Retail                      Tab           2         33        -
3       Health                      Mobile        5         103       2/7 = 0.285
2       Food                         TV           1         88        -

```

Help on here as well that if I do just groupby I will miss out the information of `category` and `duration` also what would be better way to represent the `output df` there can been multiple industry and operation is limited to just `retail`