title: Fill NaN values in dataframe with previous values in column
body: <p>Hi I have a dataframe with some missing values ex:</p>
  
  <p><a href="https://i.stack.imgur.com/kVBlT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kVBlT.png" alt="enter image description here"></a></p>
  
  <p>The black numbers 40 and 50 are the values already inputted and the red ones are to autofill from the previous values. Row 2 is blank as there is no previous number to fill.</p>
  
  <p>Any idea how I can do this efficiently? I was trying loops but maybe there is a better way</p>