SHARE
TWEET

Untitled

a guest Jun 25th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. a = np.array([[(1, 2,  3), (1, 2,  3), (1, 2, 3)],
  2.        [(1, 2,  3), (1, 2, 3), (1, 2, 3)],
  3.        [(1, 2, 3), (1, 2, 3), (1, 2, 3)]],
  4.       dtype=[('B4', '<u2'), ('B3', '<u2'), ('B2', '<u2')])
  5.      
  6. a.shape = (3,3)
  7. a[0,0] = (1,2,3)
  8.      
  9. b.shape = (3,3,3)
  10. b[0,0,0] = 1
  11. b[0,0,1] = 2
  12. b[0,0,2] = 3
  13.      
  14. b[:,:,0] ==
  15. array([[1, 1, 1],
  16.        [1, 1, 1],
  17.        [1, 1, 1]])
  18. b[:,:,1] ==
  19. array([[2, 2, 2],
  20.        [2, 2, 2],
  21.        [2, 2, 2]])
  22. b[:,:,2] ==
  23. array([[3, 3, 3],
  24.        [3, 3, 3],
  25.        [3, 3, 3]])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top