title: split dataframe into 80% of 365 days from first charge into training and testing
body: <p>I have a dataframe with columns: user, amount_spent, month, day, hour I am trying to split my dataframe into training and testing data; I want to get the first charge up until 365 days * 80% I am not sure how to do this. I created a yearly sales dataframe that contains a summary of the sales based on each user:</p>
  
  <pre><code>f1 = {'year': ['min', 'max'], 'amount_spent':['sum','mean', 'count','max']}
  yearly_sales = df.groupby('user')['year', 'amount_spent'].agg(f1).reset_index()
  yearly_sales.columns = ['user', 'sum', 'mean', 'count', 'high', 'before', 'after']
  yearly_sales['duration'] = (yearly_sales.after - yearly_sales.before) + 1
  </code></pre>
  
  <p>I am new to this so if someone could help me create this column? thank you!</p>