eelbrain.Factor.get_index_to_match

Factor.get_index_to_match(self, other)

Generate index to conform to another Factor’s order

Assuming that other is a reordered version of self, get_index_to_match() generates an index to transform from the order of self to the order of other. To guarantee exact matching, each value can only occur once in self.

Examples

>>> index = factor1.get_index_to_match(factor2)
>>> all(factor1[index] == factor2)
True