'Markowitz portfolio optimization in Python using cvxopt - how to implement constraints: short selling is not allowed

I want to implement constraints that short selling is not allowed. so I want to constraints weights>0 I cannot search any solutions. In stackoverflow, there is only one similar solution, but it is for javascript... Thank you for advance.

G = matrix(np.concatenate((-np.transpose(Mean), -np.identity(n)), 0))
h = matrix(np.concatenate((-np.ones((1,1))*r_min, np.zeros((n,1))), 0))
A = matrix(1.0, (1,n))
b = matrix(1.0)
q = matrix(np.zeros((n, 1)))
sol = qp(Cov, q, G, h, A, b)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source