I have a dict
of arrays like these:
gen = {0: [array([0])], 1: [array([1]), array([-1])]}
and I would like to save them with msgpack
:
import msgpack
with open('data.msgpack', 'wb') as file:
msgpack.pack(gen, file)
But it returns the error:
TypeError: can't serialize array([0])
What is the problem?