Skip to content

np.ndarray vs list discrepancy #33

@Sentient07

Description

@Sentient07

Hi,

I'm facing a discrepancy between np.ndarray and python list. here's a reproducible code.

(Pdb) munkres_inst.compute(cost_matrix)
*** ValueError: non-broadcastable output operand with shape (1,) doesn't match the broadcast shape (2,)
(Pdb) cost_matrix
array([[1.20000000e+20],
       [1.20000000e+20],
       [4.51233041e-01]])
(Pdb) munkres_inst.compute(cost_matrix.tolist())
[(2, 0)]
(Pdb) cost_matrix.tolist()
[[1.2e+20], [1.2e+20], [0.45123304109052526]]

Could you please let me know if this is a mistake on my end or a bug with the library? Thanks!

Regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions