title: How to get the accumulated sum over time for each group?
body: <p>I'm working with my personal music history data in which each row in the DataFrame corresponds to a single song that has been listened to. I'd like to structure the data into a DataFrame so that each artist is its own row, while each column should correspond to a unique date. The values in the cells should correspond to the accumulated amount of listens for an artist for a given date.</p>
  
  <p>I am familiar with the groupby method that comes with Pandas, but I am still not entirely sure about how I should structure the data appropriately. I think the logic should be quite the same as in a time series analysis, but I am not that familiar with them yet.</p>
  
  <p>Here's a snippet of the relevant columns of the data set:</p>
  
  <pre><code>print(df3[['artist', 'date_time',  'year', 'num_month', 'day']].head(20))
  
                      artist  date_time  year  num_month  day
  0           Porcupine Tree 2019-09-10  2019          9   10
  1           Porcupine Tree 2019-09-10  2019          9   10
  2           Porcupine Tree 2019-09-09  2019          9   10
  3                Rammstein 2019-08-10  2019          9   10
  4                     Tool 2019-08-10  2019          9   10
  5                     Tool 2019-08-09  2019          9   10
  6                     Tool 2019-08-09  2019          9   10
  7                     Tool 2019-08-08  2019          9   10
  8                     Tool 2019-08-08  2019          9   10
  9                     Tool 2019-08-08  2019          9   10
  10                    Tool 2019-08-08  2019          9   10
  11          Rotting Christ 2019-07-10  2019          9   10
  12          Rotting Christ 2019-07-10  2019          9   10
  13                  Amoral 2019-06-10  2019          9   10
  14  Harry Gregson-Williams 2019-06-10  2019          9   10
  15  Harry Gregson-Williams 2019-06-10  2019          9   10
  16               Midge Ure 2018-09-10  2019          9   10
  17             David Bowie 2018-09-10  2019          9   10
  18             David Bowie 2018-09-10  2019          9   10
  19             David Bowie 2018-09-10  2019          9   10
  </code></pre>
  
  <p>Note that date_time is of type datetime64[ns]. I also have the day, month and year stored as integers.</p>