Suppose I have two numpy arrays of the form
x = [[1,2] [2,4] [3,6] [4,NaN] [5,10]] y = [[0,-5] [1,0] [2,5] [5,20] [6,25]]
there is an effective way to merge them so that I have
xmy = [[0, NaN, -5 ] [1, 2, 0 ] [2, 4, 5 ] [3, 6, NaN] [4, NaN, NaN] [5, 10, 20 ] [6, NaN, 25 ]
I can implement a simple function using search to find the index, but this is not elegant and potentially inefficient for a large number of arrays and large sizes. Any pointer is evaluated.
python arrays numpy scipy
leon
source share