Say I have a function like so:
def function(a,b):
    for x in np.nditer(a):
        dAB = x-b
        pred = np.ceil([dAB+b*2])
        print(pred)
and
array1 = np.array([1,2,3,4,5])
array2 = np.array([4,5,6,7,8])
My output is:
function(array1,array2)
[[5. 6. 7. 8. 9.]]
[[ 6.  7.  8.  9. 10.]]
[[ 7.  8.  9. 10. 11.]]
[[ 8.  9. 10. 11. 12.]]
[[ 9. 10. 11. 12. 13.]]
How would I get an output like:
function(array1,array2)
array([5,6,7,8,9,10,11,12,13])
What I'd like is to take all the unique values across the arrays and put it into one array.
 
     
     
     
    