I have the following dataframe:

```
     'one_hot'
1        0   
2        1
3        0
4        0
5        0
6        1

```

I am wondering if there is a function that allows me to count the rows left to reach the next `1` creating a new column. So the output would be a column like:

```
     'one_hot'    'new_col'
1        0           1
2        1           0  
3        0           3       
4        0           2
5        0           1
6        1           0

```

The comments so far written are good for when the last 'one\_hot' value is a `1`, but what if it was a `0`? Is there anything that can be done? Ideally I would count the length of the piece of dataframe since the last `1` and use this to fil and