I need to get all possible combinations nCr of all possible sizes of a numpy array.
[1,2,3,4,5]
should give us a set of arrays:
[1],[2],[3],[4],[5]
[1,2],[1,3],[1,4],[1,5],[2,3],[2,4],[2,5],[3,4],[3,5]
[1,2,3],[1,2,4],[1,2,5]...[3,4,5]
[1,2,3,4],[1,2,3,5],[1,2,4,5],[1,3,4,5],[2,3,4,5]
[1,2,3,4,5]
Is there a clever way to do that?
for convenience one can do all arrays of fixed length (5): [1,0,0,0,0], [2,0,0,0,0] etc