scipy.sparse.dok_matrix. popitem# dok_matrix.popitem()[source]# Remove and return a (key, value) pair as a 2-tuple, returned in LIFO (last-in, first-out) order. Returns: keytupleThe key of the removed item. valuescalarThe value of the removed item. Raises: KeyErrorIf the dict is empty.