0

I am trying to solve a simple problem where given an array of values for bakery and cafe calculating cost matrix using optimal transport library. But I was having a dimension mismatch error. as I am new to pot(python optimal transport) library I was unable to rectify it

print('Bakery production: {}'.format(bakery_prod))
print('Cafe sale: {}'.format(cafe_prod))
print('Total croissants : {}'.format(cafe_prod.sum()))

output: Bakery production: [31. 48. 82. 30. 40. 48. 89. 73.] Cafe sale: [82. 88. 92. 88. 91.] Total croissants : 441.0

bakery_pos, cafe_pos, cost_matrix.transpose()

output:

(array([[184, 201],
        [449, 168],
        [245, 288],
        [273, 364],
        [494, 336],
        [738, 238],
        [736, 375],
        [537, 482]]),
 array([[302, 442],
        [345, 368],
        [449, 201],
        [454, 387],
        [627, 408]]),
 array([[358, 421, 211, 106, 298, 640, 501, 275],
        [326, 304, 180,  75, 181, 522, 397, 306],
        [264,  33, 289, 338, 180, 325, 460, 368],
        [455, 224, 308, 203,  91, 433, 294, 178],
        [649, 418, 502, 397, 204, 280, 142, 163]]))

enter image description here

I have tried without transposing and converting the bakery_pos to bakery_pos[:5] but still facing the same problem. can someone point out what should I need to change?

0 Answers0