join_schemes()¶
- audformat.utils.join_schemes(dbs, scheme_id)[source]¶
Join and update scheme of databases.
This joins the given scheme of several databases using
audformat.utils.join_labels()
and replaces the scheme in each database with the joined one. The dtype of allaudformat.Column
objects that reference the scheme in the databases will be updated. Removed labels are set toNaN
.This might be useful, if you want to combine databases with
audformat.Database.update()
.Joining schemes that use labels from a misc table is not supported. Please use
audformat.Database.update()
instead.- Parameters
- Raises
ValueError – if scheme labels are of different dtype or not
list
ordict
Examples
>>> db1 = Database("db1") >>> db2 = Database("db2") >>> db1.schemes["scheme_id"] = Scheme(labels=["a"]) >>> db2.schemes["scheme_id"] = Scheme(labels=["b"]) >>> join_schemes([db1, db2], "scheme_id") >>> db1.schemes scheme_id: dtype: str labels: [a, b]