1

enter image description here

In the above sample data, I have empty fields and now the task is to fill the fields with previous values. my columns are dates and the values are a number of items present for that particular article for the specific date. which would be a faster way to interpolate the missing fields. Any suggestions to build the function is appreciated.

1 Answers1

2

You can use fillna function with ffill method:

df.fillna(method='ffill', inplace=True)
serali
  • 1,282
  • 1
  • 9
  • 19