SciPy

scipy.sparse.dok_matrix.power

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

Element-wise power.