skbio.metadata.SampleMetadata.merge#
- SampleMetadata.merge(*others)[source]#
Merge this
Metadataobject with otherMetadataobjects.Returns a new
Metadataobject containing the merged contents of thisMetadataobject and others. The merge is not in-place and will always return a new mergedMetadataobject.The merge will include only those IDs that are shared across all
Metadataobjects being merged (i.e. the merge is an inner join).Each metadata column being merged must have a unique name; merging metadata with overlapping column names will result in an error.
- Parameters:
- otherstuple
One or more
Metadataobjects to merge with thisMetadataobject.
- Returns:
- Metadata
New object containing merged metadata. The merged IDs will be in the same relative order as the IDs in this
Metadataobject after performing the inner join. The merged column order will match the column order ofMetadataobjects being merged from left to right.
- Raises:
- ValueError
If zero
Metadataobjects are provided in others (there is nothing to merge in this case).
Notes
The merged
Metadataobject will always have itsid_headerproperty set to'id', regardless of theid_headervalues on theMetadataobjects being merged.