I have two 1D arrays of integers whose some differ, for example:
a = [1,2,2,0,3,5]
b = [0,0,3,2,0,0]
I would like the sum of each array to be equal to that of the smallest of the two. However I want to keep values as integers, not floats, so dividing is not an option. The solution appears to be some subsampling of the biggest array so that its sum is equal to that of the smallest one:
target = [min(sum(a), sum(b))]
However, I cannot find a function that would perform such subsampling. The only one I found are in scipy but they seem dedicated to treat audio signal. The alternative was a function of the scikit-bio package but it does not work on Python 3.7.