I have a dataframe df as below
| time | rate |
|---|---|
| 0 | 1.0 |
| 1 | 0.7 |
| 2 | 0.5 |
| 3 | 0.4 |
| 5 | 0.2 |
| 6 | 0.1 |
I want to get the maximum consecutive 'time' of it. In this example that will be 4 ('0','1','2','3'; as we don't have a '4' as time) How can I do it in Python / pandas ? Thanks!