title: Pandas filling missing value from yesterday data (same DataTime) in python
body: <p>I am trying to fill missing value by yesterday (one day back data) in python. for the same I am trying with following code but not getting expected output.</p>
  
  <p><strong>Code</strong> </p>
  
  <pre><code>import pandas as pd
  
  df = pd.read_csv(r'input_3.csv')
  saved_column = df.Value #you can also use df['column_name']
  
  
  df['DateTime'] = pd.DatetimeIndex(df['DateTime'])
  
  b = df.loc[df.Value.isnull(), 'Value'] = \
                df.loc[df.Value.isnull(), 'Value'].map(df.loc[df.Value.notnull()] \
                  .set_index('DateTime')['Value'])
  print b
  </code></pre>
  
  <p>Yesterday's Data:</p>
  
  <pre><code>block   DateTime    Value
  1   09-01-2016 00:00    -0.886492
  2   09-01-2016 01:00    -0.500995
  3   09-01-2016 02:00    4
  4   09-01-2016 03:00    5
  5   09-01-2016 04:00    2.145205
  6   09-01-2016 05:00    0.475309
  </code></pre>
  
  <p>Today's Data: </p>
  
  <pre><code>1   10-01-2016 00:00    -0.886492
  2   10-01-2016 01:00    -0.500995
  3   10-01-2016 02:00    NaN
  4   10-01-2016 03:00    NaN
  5   10-01-2016 04:00    2.145205
  6   10-01-2016 05:00    0.475309
  </code></pre>
  
  <p>Expected to fill today's data: </p>
  
  <pre><code>1   10-01-2016 00:00    -0.886492
  2   10-01-2016 01:00    -0.500995
  3   10-01-2016 02:00    5
  4   10-01-2016 03:00    2.145205
  5   10-01-2016 04:00    2.145205
  6   10-01-2016 05:00    0.475309
  </code></pre>
  
  <p>Please suggest me some approach for the same. Thank you in advance  </p>
  
  <p>I have tried using this post <a href="https://stackoverflow.com/questions/41941605/fill-values-from-one-dataframe-to-another-with-matching-ids">Fill values from one dataframe to another with matching IDs</a> but not getting expected output</p>