title: Replace nan values with data from previous months
body: <p>I have a DataFrame as follows. This DataFrame contains NAN values. I want to replace nan values with the earlier non nan value in my DataFrame from previous month(s):</p>
  <pre><code>date (y-d-m)  | value 
   2022-01-01   | 1  
   2022-02-01   | 2 
   2022-03-01   | 3     
   2022-04-01   | 4  
   ...
   2022-01-02   | nan  
   2022-02-02   | nan
   2022-03-02   | nan
   2022-04-02   | nan
   ... 
   2022-01-03   | nan  
   2022-02-03   | nan
   2022-03-03   | nan
   2022-04-03   | nan
  </code></pre>
  <p>Desired outcome</p>
  <pre><code>date (y-d-m)  | value 
   2022-01-01   | 1  
   2022-02-01   | 2 
   2022-03-01   | 3     
   2022-04-01   | 4  
   ...
   2022-01-02   | 1  
   2022-02-02   | 2
   2022-03-02   | 3
   2022-04-02   | 4
   ... 
   2022-01-03   | 1  
   2022-02-03   | 2
   2022-03-03   | 3
   2022-04-03   | 4
  </code></pre>
  <p>Data:</p>
  <pre><code>{'date (y-d-m)': ['2022-01-01', '2022-02-01', '2022-03-01', '2022-04-01',
                    '2022-01-02', '2022-02-02', '2022-03-02', '2022-04-02',
                    '2022-01-03', '2022-02-03', '2022-03-03', '2022-04-03'],
   'value': [1.0, 2.0, 3.0, 4.0, nan, nan, nan, nan, nan, nan, nan, nan]}
  </code></pre>