power — SciPy v1.15.2 Manual (original) (raw)

scipy.sparse.csr_array.

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

This function performs element-wise power.

Parameters:

nscalar

n is a non-zero scalar (nonzero avoids dense ones creation) If zero power is desired, special case it to use np.ones

dtypeIf dtype is not specified, the current dtype will be preserved.

Raises:

NotImplementedErrorif n is a zero scalar

If zero power is desired, special case it to usenp.ones(A.shape, dtype=A.dtype)