Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> np.array([[[0, 4], [2, 6]], [[1, 5], [3, 7]]], dtype='b')
- array([[[0, 4],
- [2, 6]],
- [[1, 5],
- [3, 7]]], dtype=int8)
- >>> ctypes.string_at(np.array([[[0, 4], [2, 6]], [[1, 5], [3, 7]]], dtype='b').ctypes.data, 8) # .data.tobytes() doesn't work properly
- b'\x00\x04\x02\x06\x01\x05\x03\x07'
- >>> np.array([[[0, 4], [2, 6]], [[1, 5], [3, 7]]], dtype='b').__array_interface__
- {'data': (23426096, False), 'strides': None, 'descr': [('', '|i1')], 'typestr': '|i1', 'shape': (2, 2, 2), 'version': 3}
- >>> np.array([[[0, 4], [2, 6]], [[1, 5], [3, 7]]], dtype='b').flags
- C_CONTIGUOUS : True
- F_CONTIGUOUS : False
- OWNDATA : True
- WRITEABLE : True
- ALIGNED : True
- WRITEBACKIFCOPY : False
- UPDATEIFCOPY : False
- >>> np.array([[[0, 4], [2, 6]], [[1, 5], [3, 7]]], dtype='b', order='F')
- array([[[0, 4],
- [2, 6]],
- [[1, 5],
- [3, 7]]], dtype=int8)
- >>> ctypes.string_at(np.array([[[0, 4], [2, 6]], [[1, 5], [3, 7]]], dtype='b', order='F').ctypes.data, 8)
- b'\x00\x01\x02\x03\x04\x05\x06\x07'
- >>> np.array([[[0, 4], [2, 6]], [[1, 5], [3, 7]]], dtype='b', order='F').__array_interface__
- {'data': (23304720, False), 'strides': (1, 2, 4), 'descr': [('', '|i1')], 'typestr': '|i1', 'shape': (2, 2, 2), 'version': 3}
- >>> np.array([[[0, 4], [2, 6]], [[1, 5], [3, 7]]], dtype='b', order='F').flags
- C_CONTIGUOUS : False
- F_CONTIGUOUS : True # `order` does not configure it directly; it is just computed from the current shape and strides
- OWNDATA : True
- WRITEABLE : True
- ALIGNED : True
- WRITEBACKIFCOPY : False
- UPDATEIFCOPY : False
- >>> np.array([[[0, 4], [2, 6]], [[1, 5], [3, 7]]], dtype='b', order='F').T
- array([[[0, 1],
- [2, 3]],
- [[4, 5],
- [6, 7]]], dtype=int8)
- >>> ctypes.string_at(np.array([[[0, 4], [2, 6]], [[1, 5], [3, 7]]], dtype='b', order='F').T.ctypes.data, 8)
- b'\x00\x01\x02\x03\x04\x05\x06\x07'
- >>> np.array([[[0, 4], [2, 6]], [[1, 5], [3, 7]]], dtype='b', order='F').T.__array_interface__
- {'data': (23426096, False), 'strides': None, 'descr': [('', '|i1')], 'typestr': '|i1', 'shape': (2, 2, 2), 'version': 3}
- >>> np.array([[[0, 4], [2, 6]], [[1, 5], [3, 7]]], dtype='b', order='F').T.flags
- C_CONTIGUOUS : True
- F_CONTIGUOUS : False
- OWNDATA : False
- WRITEABLE : True
- ALIGNED : True
- WRITEBACKIFCOPY : False
- UPDATEIFCOPY : False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement