Hello I have a problem when I tried to serialize an array with python, I have the dictionary
d={}
d['data']= [array([2, 5, 3], dtype=uint8), array([4, 1, 9], dtype=uint8)]
but my error is:
'array' is not defined
so, I have 2 questions:
1.- how can I do an array like:
array([2, 5, 3],[4, 1, 9], dtype=uint8)
to create the array I use
append()
and how can I serialize the dictionary with the form of the array(question 1) using the next function
with open('outp', 'wb') as fo:
pickle.dump(d, fo, 2)
If I remove the words 'array' and 'dtype=uint8' it has no errors, but I think that is not the correct form to serialize an array Thanks
from numpy import array