Advertisement
nekotrap

Untitled

Nov 12th, 2021
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. def matrix_work(seed):
  2. np.random.seed(seed)
  3. A = np.random.randint(-10, 9, (5, 5))
  4. B, C = [], []
  5. for st in A:
  6. if 0 in st:
  7. B.append(list(st))
  8.  
  9. A = np.transpose(A)
  10. for st in A:
  11. res = 0
  12. for item in st:
  13. if item < 0:
  14. res -= 1
  15. else:
  16. res += 1
  17. if res > 0:
  18. C.append(list(st))
  19. B = np.array(B)
  20. print(B)
  21. print()
  22. C = np.array(C).transpose()
  23. print(C)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement