k = 7
n = 30
def f(k,n):
p = []
for i in range(n):
p.append(len(list(itertools.combinations([x for x in range(2**k)],i)))
The problem that the code above works slow and breaks with error for bigger values of variable. I've tried sklearn.cartesian, but got permutationa as a result when needed combination. I know that there is a way to make it work faster with numpy, but I haven't figure out how to implement it yet. Similar question has answer about numpy, but I don't understand how that np.column_stack((np.repeat(a, b.size),np.tile(b, a.size)))
should work in my case. As I see now, i will be a number of demenion of the array and will change and I don't fully undertand what to do with this fact.