если есть
Код: Выделить всё
[[5 7 1 2]
[4 8 1 4]
[4 0 1 9]
[2 7 5 0]]
Код: Выделить всё
[[9 8 7 7]
[5 5 4 4]
[4 2 2 1]
[1 1 0 0]]
Код: Выделить всё
import numpy as np
MatriX = np.random.randint(10, size=(4,4))
print(MatriX)
for i in range(10):
for j in range(10):
a=np.sort(-MatriX,axis=1)*-1
b=np.sort(-a,axis=0)*-1
c=np.transpose(b)
d=np.sort(-c,axis=1)*-1
e=np.sort(-d,axis=0)*-1
print(e)
Подробнее здесь: https://stackoverflow.com/questions/790 ... all-matrix