SciPy

scipy.sparse.dok_matrix.setdefault

dok_matrix.setdefault(self, key, default=None, /)

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

Previous topic

scipy.sparse.dok_matrix.set_shape

Next topic

scipy.sparse.dok_matrix.setdiag