import numpy as np
matrix = np.array([
[0, 1, 0, 0, 0],
[0, 0, 0, 1, 0],
[1, 0, 0, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 0, 0, 1]
])
num_rows = matrix.shape[0]
identity = np.eye(num_rows)
for i in range(len(matrix)):
for j in range(len(identity)):
product = matrix[i] * identity[j]
if np.any(product > 0):
print(f"{i+1} > {j+1}")
dimecres, 27 de desembre del 2023
row sorting
Subscriure's a:
Comentaris del missatge (Atom)
Cap comentari:
Publica un comentari a l'entrada