scipy.sparse.csc_matrix.

power#

csc_matrix.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

dtypedtype, optional

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

Returns:
sparse array/matrix

Result of raising all elements to the power n.

Raises:
NotImplementedErrorif n is a zero scalar

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