scipy.sparse.dok_matrix. update# dok_matrix.update(val)[source]# Update values from a dict, sparse dok or iterable of 2-tuples like .items() Keys of the input must be sequences of nonnegative integers less than the shape for each axis.