geetools.List.ListAccessor.complement#

geetools.List.ListAccessor.complement(other)#

Compute the complement of the current list and the other list.

The mthematical complement is the list of elements that are in the current list but not in the other list and vice-versa.

Parameters:

other (geetools.types.ee_list) – The list to compute the complement with.

Returns:

A list of strings corresponding to the complement of the current list and the other list.

Return type:

ee.List

Examples

import ee, geetools

ee.Initialize()

l1 = ee.List(["1", "2", "3"])
l2 = ee.List(["2", "3", "4"])

l1.geetools.complement(l2).getInfo()