human
Pandas changing cell values based on another cell
assistant
Here is some code to change NaN values in dataframe `df` using preceding values in the frame

df.fillna(method='ffill', inplace=True)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.