triu

  • np.triu詳解

    一、概述 在NumPy中,我們經常會使用np.triu函數來獲取矩陣的上三角形部分。該函數的作用是返回一個數組的上三角形部分: import numpy as np a = np.…

    編程 2024-12-13