Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scipy.optimize as sc
- c = [-3, -4]
- A = [
- [1, 2],
- [1, 1],
- [-2, -1]
- ]
- b = [500, 350]
- res = sc.linprog(c, A, b).x
- print("Raw result:", res)
- formattedRes = []
- for i in range(len(res)):
- formattedRes.append(round(res[i], 3))
- print("Formatted result:", formattedRes)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement