title: Is there a function that sums dependent data types?
body: <p>I have a dataframe in pandas with the columns <code>Year</code> (int), <code>Loc</code> (ordered pair of ints), and <code>Rain</code> (boolean). There are many data points of <code>Rain</code> for each <code>Year</code>. For example, in the graph, you might see:</p>
  
  <pre><code>Year     |    Loc     |     Rain
  1700          (0, 0)          1
  1700          (0, 0)          1
  1700          (5, 6)          0
  </code></pre>
  
  <p>etc.</p>
  
  <p>Is there a function that will combine these data points into a single data point if <code>Year</code> AND <code>Loc</code> are the same, with <code>Rain</code> as the sum of all the <code>Rain</code> points of the corresponding <code>Year</code> AND <code>Loc</code> points?</p>