scipy.sparse.csc_array.

power#

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

此函數執行逐元素冪運算。

參數:
n純量

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

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

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