Comparing two dictionaries with numpy matrices as values

后端 未结 3 1617
死守一世寂寞
死守一世寂寞 2020-12-11 15:06

I want to assert that two Python dictionaries are equal (that means: equal amount of keys, and each mapping from key to value is equal; order is not important). A simple way

3条回答
  •  悲哀的现实
    2020-12-11 15:43

    You can use numpy.testing.assert_equal

    http://docs.scipy.org/doc/numpy/reference/generated/numpy.testing.assert_equal.html

提交回复
热议问题