numpy/numpy — pull request #4182 by juliantaylor (2014-01-10 00:33:54+00:00)
Title: ENH: optimize np.where via nditer with external loop

Implementation via PyArray_Choose is very slow, a direct implementation
is 10 times faster.
Optimizing Choose is more complicated due to its higher complexity and
would require specialization for optimal np.where anyway, but it is
something that could be done in future.