scipy.sparse.bsr_matrix.

power#

bsr_matrix.power(n, dtype=None)[source]#

此函數執行元素級的次方運算。

參數:
n純量

n 是一個非零純量 (非零避免建立密集矩陣)。如果需要零次方,請特殊處理以使用 np.ones

dtype如果未指定 dtype,則將保留目前的 dtype。
引發:
NotImplementedError如果 n 是一個零純量

如果需要零次方,請特殊處理以使用 np.ones(A.shape, dtype=A.dtype)