Skip to content
Advertisement

pd Fill NAN with increasing incremental Value python

Hi I am trying to do an incremental increase on the data I have for NaN values for example:

Day Reding
1 NaN
2 2.5
3 NaN
4 NaN
5 NaN
6 3.9
7 NaN
8 3.4

To this:

Day Reading
1 2.5
2 2.5
3 2.85
4 3.2
5 3.55
6 3.9
7 3.65
8 3.4

Advertisement

Answer

As Pranav mentioned, you can try using interpolation

JavaScript

Output

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement