Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert numpy array to byteslist

>>> x = np.array([[0, 1], [2, 3]], dtype='<u2')
>>> x.tobytes()
b'x00x00x01x00x02x00x03x00'
>>> x.tobytes('C') == x.tobytes()
True
>>> x.tobytes('F')
b'x00x00x02x00x01x00x03x00'
Source by numpy.org #
 
PREVIOUS NEXT
Tagged: #convert #numpy #array #byteslist
ADD COMMENT
Topic
Name
3+8 =