title: Pandas: Last time when a column had a non-nan value
body: <p>Let's assume that I have the following data-frame:</p>
  
  <pre><code>df = pd.DataFrame({"id": [1, 1, 1, 2, 2], "nominal": [1, np.nan, 1, 1, np.nan], "numeric1": [3, np.nan, np.nan, 7, np.nan], "numeric2": [2, 3, np.nan, 2, np.nan], "numeric3": [np.nan, 2, np.nan, np.nan, 3], "date":[pd.Timestamp(2005, 6, 22), pd.Timestamp(2006, 2, 11), pd.Timestamp(2008, 9, 13), pd.Timestamp(2009, 5, 12), pd.Timestamp(2010, 5, 9)]})
  </code></pre>
  
  <p>As output, I want to get a data-frame, that will indicate the number of days that have passed since a non-nan value was seen for that column, for that <code>id</code>. If a column has a value for the corresponding date, or if a column doesn't have a value at the start for an new <code>id</code>, the value should be a 0. In addition, this is supposed to be computed only for the numeric columns. With that said, the output data-frame should be:</p>
  
  <pre><code>output_df = pd.DataFrame({"numeric1_delta": [0, 234, 1179, 0, 362], "numeric2_delta": [0, 0, 945, 0, 362], "numeric3_delta": [0, 0, 945, 0, 0]})
  </code></pre>
  
  <p>Looking forward to your answers!</p>