triu

  • np.triu详解

    一、概述 在NumPy中,我们经常会使用np.triu函数来获取矩阵的上三角形部分。该函数的作用是返回一个数组的上三角形部分: import numpy as np a = np.…

    编程 2024-12-13