Through the filtering process, I got this table.

|  | Index | Next\_Index | Value |
| --- | --- | --- | --- |
| 559 | 559 | 717 | 1 |
| 856 | 856 | 950 | 1 |

Based on the table I know I need to set the value to -1 between **Index** and **Next\_Index** (in my case, I need to set the value to -1 if my dataframe index is between 559 and 717, as well as the index is between 856 and 950). The outcome should be the same as

```
df.loc[559:717, ("value")] = -1
df.loc[856:950, ("value")] = -1

```

I am not sure how can I could get this done given I have the pandas table. Thanks a lot.