skbio.metadata.SampleMetadata.merge#
- SampleMetadata.merge(*others)[source]#
Merge this
Metadata
object with otherMetadata
objects.Returns a new
Metadata
object containing the merged contents of thisMetadata
object and others. The merge is not in-place and will always return a new mergedMetadata
object.The merge will include only those IDs that are shared across all
Metadata
objects 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
Metadata
objects to merge with thisMetadata
object.
- Returns:
- Metadata
New object containing merged metadata. The merged IDs will be in the same relative order as the IDs in this
Metadata
object after performing the inner join. The merged column order will match the column order ofMetadata
objects being merged from left to right.
- Raises:
- ValueError
If zero
Metadata
objects are provided in others (there is nothing to merge in this case).
Notes
The merged
Metadata
object will always have itsid_header
property set to'id'
, regardless of theid_header
values on theMetadata
objects being merged.