Skip to main content
`Ctrl`+`K`

# skbio.stats.ordination.OrdinationResults.rename

OrdinationResults.rename(mapper, matrix='samples', strict=True)

  Rename sample or feature IDs in the data matrix.

  Parameters:
    mapper dict or callable

      A dictionary or function that maps current IDs to new IDs.

    matrix str, optional

      Specifies which matrix contains the IDs to be renamed. Either “samples” (default) or “features”.

    strict bool, optional

      If `True` (default), every ID in the matrix must be included in `mapper`. If `False`, only the specified IDs will be renamed.

  Raises:
    ValueError

      If `mapper` does not contain all of the same IDs in the matrix whereas in strict mode.

    ValueError

      If renaming features but self does not contain features.

    ValueError

      If `matrix` is neither “samples” nor “features”.