scipy.sparse.lil_array. trace# lil_array.trace(offset=0)[原始碼]# 返回稀疏陣列/矩陣對角線的總和。 參數: offset整數, 選填要取得哪個對角線,對應於元素 a[i, i+offset]。預設值:0(主對角線)。