title: How to sum in pandas by unique index in several columns?
body: <p>I have a pandas DataFrame which details online activities in terms of "clicks" during an user session. There are as many as 50,000 unique users, and the dataframe has around 1.5 million samples. Obviously most users have multiple records.</p>
  
  <p>The four columns are a unique user id, the date when the user began the service "Registration", the date the user used the service "Session", the total number of clicks.</p>
  
  <p>The organization of the dataframe is as follows:</p>
  
  <pre><code>User_ID    Registration  Session      clicks
  2349876    2012-02-22    2014-04-24   2 
  1987293    2011-02-01    2013-05-03   1 
  2234214    2012-07-22    2014-01-22   7 
  9874452    2010-12-22    2014-08-22   2 
  ...
  </code></pre>
  
  <p>(There is also an index above beginning with 0, but one could set <code>User_ID</code> as the index.)</p>
  
  <p>I would like to aggregate the total number of clicks by the user since Registration date. The dataframe (or pandas Series object) would list User_ID and "Total_Number_Clicks". </p>
  
  <pre><code>User_ID    Total_Clicks
  2349876    722 
  1987293    341
  2234214    220 
  9874452    1405 
  ...
  </code></pre>
  
  <p>How does one do this in pandas? Is this done by <code>.agg()</code>? Each <code>User_ID</code> needs to be summed individually. </p>
  
  <p>As there are 1.5 million records, does this scale? </p>