KeyComplement
KeyComplement[{assocall,assoc1,assoc2,…}]
generates an association in which only elements whose keys appear in assocall but not in any of the associ are retained.
Details and Options
- KeyComplement preserves the order of the elements in assocall.
- KeyComplement can be used not only on Association objects, but also on lists of rules.
- KeyComplement[{assocall, assoc1, …}, SameTesttest] applies test to each pair of keys of the elements in assocall and the associ to determine whether they should be considered the same.
Examples
open allclose allBasic Examples (4)
Find a key that is not present elsewhere:
A single element of a list remains unchanged:
A list of rules is converted to an Association:
Text
Wolfram Research (2015), KeyComplement, Wolfram Language function, https://reference.wolfram.com/language/ref/KeyComplement.html.
CMS
Wolfram Language. 2015. "KeyComplement." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/KeyComplement.html.
APA
Wolfram Language. (2015). KeyComplement. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KeyComplement.html