Is there any way we can do something like merge in mergesort using numpy function?
some function like merge:
a = np.array([1,3,5])
b = np.array([2,4
You can use
from numpy import concatenate, sort
c = concatenate((a,b))
c.sort(kind='mergesort')
I am afraid you can't do better than this, unless you write your own sorting function as a python extension, à la cython.
See this question for a similar problem, but keeping only the unique values in the merged array. The benchmarks and comments there are insightful as well.