title: Solution of checking retention of users through RESAMPLE
body: <p>For the purpose of finding frequency and retention of users on a service, I tried to re sample data but fail as it lose parts of my data. </p>
  
  <p><em>Please note that the frequency could be month, year, every 3 days or 5 days</em></p>
  
  <p>This is sample data:</p>
  
  <pre><code>a=pd.DataFrame([[Timestamp('2019-01-01'),'Jack'],
                  [Timestamp('2019-01-15'),'Jack'],
                  [Timestamp('2019-02-6'),'Lina'],
                  [Timestamp('2019-03-23'),'Tom'],
                  [Timestamp('2019-03-22'),'Jack'],
                  [Timestamp('2019-02-14'),'Jack']],columns=['Date','Name'])
      Date  Name
  0 2019-01-01  Jack
  1 2019-01-15  Jack
  2 2019-02-06  Lina
  3 2019-03-23   Tom
  4 2019-03-22  Jack
  5 2019-02-14  Jack
  </code></pre>
  
  <p>My expected result:</p>
  
  <pre><code>            Name
  Date            
  2019-01-31  Jack
  2019-02-28  Jack
  2019-03-31  Jack
  2019-02-28  Lina
  2019-03-31   Tom
  </code></pre>
  
  <p>My so far attemption:</p>
  
  <pre><code>a=a.set_index('Date')
  a.index=pd.to_datetime(z.index)
  a=a.resample('M').pad()
  </code></pre>
  
  <p>The result</p>
  
  <pre><code>            Name
  Date            
  2019-01-31  Jack                #Most of data dropped
  2019-02-28  Jack
  2019-03-31   Tom
  </code></pre>