I have a pandas dataframe which has sections looking like this (the zeros are NaN's):
...
18 19 20
197 14 28 14
198 14 0 14
200 0 0 0
201 0 0 0
202 15 23 12
203 16 0 18
204 0 0 0
205 0 0 0
...
I need to fill rows that have NaN's on specific columns with values from the last row which has no NaN's on those columns.
In my example, rows 200,201 would be filled with values from row 197, and rows 204,205 from row 202.
LE: Rows 198&203 don't have NaN's on all columns I'm interested in, so they're left alone.
What would be a pythonic way of writing this?