Advertisement
yclee126

numpy remove array

Sep 24th, 2021
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. import numpy as np
  2. import cv2
  3.  
  4. b = np.array([
  5. [1, 2, 3],
  6. [4, 5, 6],
  7. [7, 8, 9]
  8. ], dtype='float')
  9.  
  10. b = np.delete(b, 0, 0) # up
  11. b = np.delete(b, -1, 0) # down
  12. b = np.delete(b, 0, 1) # left
  13. b = np.delete(b, -1, 1) # right
  14.  
  15. print(b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement