title: how to fill in the missing values using the previous and post values
body: <p>If my data is:</p>
  
  <pre><code>a=pd.DataFrame({'Array1':[None,1,2,None,3,None,4,5,6,None]})
  </code></pre>
  
  <p>I want to fill in the missing values so that the data is:</p>
  
  <pre><code>1,1,2,2.5,3,3.5,4,5,6,6
  </code></pre>
  
  <p>You can see that the first missing value is filled as 1 because the second value is 1, which is the closest value. And the last value is missing. I fill in 6 because the closest one is 6. Then, I use (2+3)/2=2.5 to fill in the fourth missing value, i.e., the mean of the previous and post values.</p>
  
  <p>I do not know if Python has a function to do this? If so, could anyone give me some advice?</p>