DistanceMatrix.
filter
(ids, strict=True)[source]¶Filter the dissimilarity matrix by IDs.
State: Experimental as of 0.4.0.
ids (iterable of str) – IDs to retain. May not contain duplicates or be empty. Each ID must be present in the dissimilarity matrix.
strict (bool, optional) – If strict is True
and an ID that is not found in the distance
matrix is found in ids, a MissingIDError
exception will be
raised, otherwise the ID will be ignored.
Filtered dissimilarity matrix containing only the IDs specified in ids. IDs will be in the same order as they appear in ids.
MissingIDError – If an ID in ids is not in the object’s list of IDs.