I want to generate all the possible sequences of a specific length from a integer interval. (np.arange(start,end)) If it was only sub-multisets of a set of a specific length I could go for: https://stackoverflow.com/a/4941846/257640 Which I am not sure if it would be the most efficient.
So the "subseq" function will be like this:
subseq(np.arange(1,4),2)
should return:
[[1,1],
[1,2],
[1,3],
[2,2],
[2,3],
[3,3]]
Thank you.