title: How to implement sumifs with multiple conditions including date ranges in python?
body: <p>i would like to implement a sumifs equivalent calculation in python but not sure how to do it.</p>
  <pre><code>data={'product_id':['a','a','b','b'],
        'start':[datetime.date(2016,1,1),datetime.date(2016,1,1),datetime.date(2016,1,3),datetime.date(2016,1,1)],
        'end':[datetime.date(2016,1,4),datetime.date(2016,1,3),datetime.date(2016,1,4),datetime.date(2016,1,3)],
        'store':['X','Y','X','Y']}
  df=pd.DataFrame.from_dict(data)
  
  sales={'date':[datetime.date(2016,1,1),datetime.date(2016,1,2),datetime.date(2016,1,3),datetime.date(2016,1,4),
        datetime.date(2016,1,1),datetime.date(2016,1,2),datetime.date(2016,1,3),datetime.date(2016,1,4),
        datetime.date(2016,1,1),datetime.date(2016,1,2),datetime.date(2016,1,3),datetime.date(2016,1,4),
        datetime.date(2016,1,1),datetime.date(2016,1,2),datetime.date(2016,1,3),datetime.date(2016,1,4)],
        'product':['a','a','a','a','b','b','b','b','a','a','a','a','b','b','b','b'],
         'store':['X','X','X','X','X','X','X','X','Y','Y','Y','Y','Y','Y','Y','Y'],
         'sales':[20,30,59,110,30,40,80,20,80,59,110,30,40,80,20,10]}
  df2=pd.DataFrame.from_dict(sales)
  </code></pre>
  <p>I want to summarize the sales for each of the product by store per the time range defined in df. In excel I can use sumifs function but not sure how to do this in python. Can someone help me? Thank you!</p>