Currently I have the following dataframe:
| index | value |
|---|---|
| 0 | 1 |
| 1 | -1 |
| 2 | -1 |
| 3 | -1 |
| 4 | 6 |
| 5 | -1 |
| 6 | -1 |
| 7 | -1 |
| 8 | 10 |
All those value equal to -1 means N/A and the value should be increasing. Therefore I would like to generate another two columns that should indicate the possible min and possible max value, and the possible min and max is based on the valid value inside the value column.
The exptected output would be like this:
| index | value | possible min | possible max |
|---|---|---|---|
| 0 | 1 | ||
| 1 | -1 | 1 | 6 |
| 2 | -1 | 1 | 6 |
| 3 | -1 | 1 | 6 |
| 4 | 6 | ||
| 5 | -1 | 6 | 10 |
| 6 | -1 | 6 | 10 |
| 7 | -1 | 6 | 10 |
| 8 | 10 |
I would use the extra column to find the fillna value using my own matching logic.