title: Linear optimisation in python using cvxpy
body: <p>this is a simple example of LP using cvxpy</p>
  <pre><code>import cvxpy as cp
  x1 = cp.Variable()
  x2 = cp.Variable()
  objective = cp.Minimize(0.3*x1 + 0.4*x2)
  constraints = [
      4.6*x1 + 58.8*x2 &gt;= 300,
      52*x1 + 33*x2 &gt;= 2000,
      152*x1 + 133*x2 &gt;= 5000,
  ]
  linear_program = cp.Problem(objective, constraints)
  result = linear_program.solve()
  </code></pre>
  <p>my question is if I have the same constraints in the form of a dataFrame</p>
  <pre><code>A = pd.DataFrame([[4.6,58.8],[52,33],[152,133]])
  c= [0.3,0.4]
  b = [300,2000,5000]
  </code></pre>
  <p>then how do I transform A,b and c to put it through the cvxpy optimiser?
  i.e.
  converting the dataFrame A, b to the format</p>
  <pre><code>4.6*x1 + 58.8*x2 &gt;= 300,
  52*x1 + 33*x2 &gt;= 2000,
  152*x1 + 133*x2 &gt;= 5000,
  </code></pre>
  <p>and c to</p>
  <pre><code>0.3*x1 + 0.4*x2
  </code></pre>
  <p>Its easy to manually type if the number of constraints and variable are limited (3 and 2 in this case), but my acutal problem has over 50+ variables and over 80+ constraints in the form of dataFrames (and the numbers can keep changing so I cant hardcode the constraints).</p>
  <p>#########Edits-
  updated the shape of the dataFrame A, which was previously incorrect</p>