Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def matrix_work(seed):
- np.random.seed(seed)
- A = np.random.randint(-10, 9, (5, 5))
- B, C = [], []
- for st in A:
- if 0 in st:
- B.append(list(st))
- A = np.transpose(A)
- for st in A:
- res = 0
- for item in st:
- if item < 0:
- res -= 1
- else:
- res += 1
- if res > 0:
- C.append(list(st))
- B = np.array(B)
- print(B)
- print()
- C = np.array(C).transpose()
- print(C)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement