ArrayComponents
ArrayComponents[array]
gives an array in which all identical elements of array are replaced by an integer index representing the component in which the element lies.
ArrayComponents[array,level]
finds the identical elements at the specified level in array
ArrayComponents[array,level,rules]
uses a rule or a list of rules for specifying the labels.
Details
- ArrayComponents returns a label matrix where identical elements are represented by consecutive non-negative integers.
- Occurrences of zeros or None in array are always labeled with zeros.
- ArrayComponents can be used to canonicalize label matrices.
Examples
open allclose allBasic Examples (3)
Scope (3)
ArrayComponents works with arbitrarily nested lists of symbols:
Text
Wolfram Research (2010), ArrayComponents, Wolfram Language function, https://reference.wolfram.com/language/ref/ArrayComponents.html (updated 2012).
CMS
Wolfram Language. 2010. "ArrayComponents." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/ArrayComponents.html.
APA
Wolfram Language. (2010). ArrayComponents. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ArrayComponents.html