Given a raw binary representation of a numpy
array, what is the complete set of metadata needed to unambiguously restore the array?
For example,
>>> np.fromstring( np.array([42]).tostring())
array([ 2.07507571e-322])
which is to be expected (with a hindsight, at least): here the I haven't told fromstring
to expect ints, so it goes with the default float.
But it seems to me that just specifying the dtype=np.float64
or similar may or may not be sufficient. For example,
>>> a = np.array([42.])
>>> a.dtype
dtype('float64')
>>> a.dtype.byteorder
'='
which the docs tell me means 'native order'. Meaning, it's going to be interpreted differently on a big-endian and little-endian machines --- or am I missing something simple?