Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. import scipy.optimize as sc
  2.  
  3. c = [-3, -4]
  4.  
  5. A = [
  6. [1, 2],
  7. [1, 1],
  8. [-2, -1]
  9. ]
  10.  
  11. b = [500, 350]
  12.  
  13. res = sc.linprog(c, A, b).x
  14. print("Raw result:", res)
  15. formattedRes = []
  16. for i in range(len(res)):
  17. formattedRes.append(round(res[i], 3))
  18. print("Formatted result:", formattedRes)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement