>>> x = np.array([[0, 1], [2, 3]], dtype='<u2') >>> x.tobytes() b'x00x00x01x00x02x00x03x00' >>> x.tobytes('C') == x.tobytes() True >>> x.tobytes('F') b'x00x00x02x00x01x00x03x00'