title: Parallelize loop over numpy rows
body: <p>I need to apply the same function onto every row in a numpy array and store the result again in a numpy array.</p>
  
  <pre><code># states will contain results of function applied to a row in array
  states = np.empty_like(array)
  
  for i, ar in enumerate(array):
      states[i] = function(ar, *args)
  
  # do some other stuff on states
  </code></pre>
  
  <p><code>function</code> does some <strong>non trivial</strong> filtering of my data and returns an array when the conditions are True and when they are False. <code>function</code> can either be pure python or cython compiled. The filtering operations on the rows are complicated and can depend on previous values in the row, this means I can't operate on the whole array in an element-by-element fashion</p>
  
  <p>Is there a way to do something like this in dask for example?</p>