I have the following dataframe: df
name width length
timestamp
2019-08-01 00:00:08 10 10.0 NaN
2019-08-01 00:00:19 10 NaN NaN
2019-08-01 00:00:56 10 NaN 86.0
2019-08-01 00:00:08 12 NaN 90
2019-08-01 00:00:19 12 12.0 NaN
2019-08-01 00:00:28 12 NaN NaN
I would like to apply forward and backward fill on the columns 'width' and 'length' within for the column 'name'. The result would look like this:
name width length
timestamp
2019-08-01 00:00:08 10 10.0 86
2019-08-01 00:00:19 10 10.0 86
2019-08-01 00:00:56 10 10.0 86
2019-08-01 00:00:08 12 12.0 90
2019-08-01 00:00:19 12 12.0 90
2019-08-01 00:00:28 12 12.0 90
Any ideas how to do this?