I have 3 independent numpy.array and need to concatenate them with another 3 within a loop thousands of times. For the sake of performance, I would like to know if there is some way to do these 3 concatenate with only one numpy.concatenate() call.
Right now I have:
arr1 = np.concatenate([arr1, _arr1])
arr2 = np.concatenate([arr2, _arr2])
arr3 = np.concatenate([arr3, _arr3])
And I would like to get the same result with just one call, for example:
arr = [arr1, arr2, arr3]
_arr = [_arr1, _arr2, _arr3]
arr = np.concatenate([arr, _arr])
Is that somehow possible? If not, what would be the best approach?
Example of an input and desired output:
#Inputs
arr1 = [1,2]
arr2 = [3,4]
arr3 = [5,6]
_arr1 = [-1,-2]
_arr2 = [-3,-4]
_arr3 = [-5,-6]
#Output
arr = [[1,2,-1,-2], [3,4,-3,-4], [5,6,-5,-6]]