python-取矩阵的上下三角形矩阵

arr = np.triu([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 0)
print(arr)

你可能感兴趣的:(Python)