title: Filter data array on multiple conditions
body: <p>From xarray's tutorial data, I want to extract a <code>DataArray</code> that contains number of warm days in month, defined as between 22 and 30 Celcius:</p>
  
  <pre><code>airtemps = xr.tutorial.load_dataset('air_temperature')
  airtemps = airtemps.sel(time=slice('2013-01-01', '2013-12-31'))
  airtemps['air'] = airtemps.air - 273.15
  
  air_day = airtemps.resample('1D', 'time', how='mean')
  # Define multiple conditions - How can this be done programatically?
  </code></pre>
  
  <p>I am now looking for a way to create this map below programmatically, also being able to add more conditions</p>
  
  <pre><code>meets_condition = (air_day.air &gt; 22) &amp; (air_day.air &lt; 30)
  warm_days = meets_condition.resample('M', dim='time', how='sum')
  </code></pre>
  
  <p>Conditions could be defined like so:</p>
  
  <pre><code>not_cold = ('air',  operator.ge, 22)
  not_hot  = ('air',  operator.le, 30)
  </code></pre>
  
  <p>I can do this simply with one condition:</p>
  
  <pre><code>variable, operator_fn, value = not_cold
  meets_condition = operator_fn(air_day[variable], value)
  warm_but_possibly_hot_days = meets_condition.resample('M', dim='time', how='sum')
  </code></pre>
  
  <p>But I'm struggeling adding multiple, dynamically. I can do this</p>
  
  <pre><code>comfy_warm = [not_cold, not_hot]
  
  all_maps = [fn(air_day[var], val) for var, fn, val in comfy_warm]
  (all_maps[0] &amp; all_maps[1]).resample('M', dim='time', how='sum')
  </code></pre>
  
  <p>But I'm looking to do sth. like this</p>
  
  <pre><code>np.all(all_maps).resample('M', dim='time', how='sum')
  </code></pre>
  
  <p>Here's a <a href="https://gist.github.com/TomTom101/25e0e76f11a5da57523a60fb280005c1" rel="nofollow noreferrer">gist</a> for convenience. As always, I am thankful in advance</p>