[Numpy-discussion] merge_arrays is very slow; alternatives?

Pauli Virtanen pav@iki...
Fri Nov 26 14:27:08 CST 2010


On Fri, 26 Nov 2010 20:57:30 +0100, Gerrit Holl wrote:
[clip]
> I wonder, am I missing something or have I really written a significant
> improvement in less than 10 LOC? Should I file a patch for this?

The implementation of merge_arrays doesn't look optimal -- it seems to 
actually iterate over the data, which should not be needed.

So yes, rewriting the function would be useful. The main difficulty in 
the rewrite seems to be appropriate mask handling, but slicing is a 
faster way to do that.

-- 
Pauli Virtanen



More information about the NumPy-Discussion mailing list